WmlComparer fails when editing merged cells

Home Forums Open-Xml-PowerTools WmlComparer fails when editing merged cells

This topic contains 5 replies, has 3 voices, and was last updated by  hostersdbi 6 years, 12 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4019

    hostersdbi
    Participant

    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.

    http://binau.net/wmlcompare/org.docx
    http://binau.net/wmlcompare/mod.docx

    The result of running this through the WmlComparer is:

    http://binau.net/wmlcompare/compare.docx

    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.

    #4020

    Eric White
    Keymaster

    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, Eric

    #4023

    hostersdbi
    Participant

    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!

    #4066

    hostersksj
    Participant

    Hi Eric,

    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?

    Best regards,
    Kim

    #4068

    Eric White
    Keymaster

    Hi Kim –

    Sure – my email is eric@ericwhite.com

    You can connect with me on linkedin, which is a convenient way to get in touch. Sometimes my spam filters block real people. I’ll watch for your mail.

    Best, Eric

    #4331

    hostersdbi
    Participant

    Hi Eric,

    We have managed to make quite a bit of headway since we last heard from you. We were able to leverage some pre- and post-processing of the XML to mitigate some of the issues we experienced with the compare logic (merged cells being just one of these). However we’re still facing some challenges, and are still limited by the fact that the compare method itself is largely a black box to us. Thus we would still be very interested in hearing from you and are of course prepared to pay for your time if you can make yourself available – for sparring, knowledge sharing and perhaps to help us investigate one or two specific problems.

    I have sent you an e-mail on March 18 from db@capworks.eu (CapWorks has taken over this project from Hosters). I would love to hear back from you at your convenience.

    Regards,
    Daniel Do Binau

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.