WmlComparer fails when editing merged cells
December 14, 2016 at 5:02 pm #4019
The WmlComparer handles standard tables very well, but merged cells seem to pose a problem.
If I edit a merged cell, the WmlComparer treats the entire table as having been deleted and then re-created.
Here is a very simple set of example files to illustrate the problem. It is a simple 2×2 table where the two rows have been merged in the rightmost column.
The result of running this through the WmlComparer is:
Here it shows the entire table as having been deleted and then inserted, which is obviously not what we want.
I have looked a bit into the code and am prepared to have a go at it myself, but any help or pointers that Eric or anyone else can provide would be much appreciated.
And naturally, if Eric is able to fix this in a jiffy through his extensive knowledge of the existing code, I would be eternally grateful 🙂
Thanks in advance for any and all assistance you can provide. I really appreciate it.December 14, 2016 at 5:15 pm #4020
The basic problem is that the Open XML markup itself does not properly track merging / unmerging of cells. Word itself will not track these changes. If you turn on tracked changes, and merge / unmerge a cell, you will get a modal dialog from Word indicating that changes will not be tracked.
It is possible to compare (using Word) two documents that have merged cells, and Word sometimes does an OK job of this, but other times it totally messes it up.
Given my schedule and budget for WmlComparer, I decided to not attempt to generate proper markup for merged cells (and am not even sure it is possible). Therefore comparing tables that contain merged cells is not a feature of the module.
It is possible to enhance this module such that if two tables have identical structure, i.e. same number of cells on each row, same merging, etc., then could do deltas in the merged cells. This is not a trivial project, but not super difficult. It is important that it be done in the proper structural way – to fit into the existing infrastructure for dealing with tables and whatnot. My estimate is that it should take a day or two. It is possible that I could look at this in January.
Best, EricDecember 14, 2016 at 5:27 pm #4023
Thanks for the extremely quick reply Eric. Truly appreciated.
What we need is exactly what you describe in the last paragraph. We don’t need to handle cases where the over-all table structure has changed, just cases of editing cells inside a table that contains merged cells.
I will discuss our options with my colleagues and maybe get back to you. Until then, thanks again for your swift assistance!January 11, 2017 at 6:54 am #4066
We would like to continue with above, if your schedule allows for it. Would it be possible for you to send me an email with your contact information, so I can send you our list of requirements/questions?
KimJanuary 11, 2017 at 2:01 pm #4068
You must be logged in to reply to this topic.