ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
40 stars 22 forks source link

Strange behaviour while using Word comments for M2Doc tags #19

Open cboudjennah opened 8 years ago

cboudjennah commented 8 years ago

M2Doc version: 0.7.1 Execution platform: Capella 1.0.1 Acceleo Query version: 4.1 POI Version: 3.13.0

Initial conditions: -M2Doc installed -a working template without comments is used

Steps to reproduce: -add a Word comment to a M2Doc tag content -generate the document and check it

Expected result: -EITHER the comment is repeated in every element generated by the tag -OR the comment is not reproduced in the generated document

Actual result: -Opening the generated document leads to a Word error display (sorry it was at a customer's and I couldn't write it down) -Lots of empty Word comments are added to the generated document -The Word comment of the taf is reproduced at every item generated by the tag (NOTE: this may be the expected behaviour depending on what the developers wanted to do, see "Expected results" section above)

ylussaud commented 5 years ago

This issue need a deep management of comments because some comments might need to be duplicated and other removed. The error here arise when many comments with a same id are produced in the document.xml.

A good starting point for such management might be document.getCommentsRange().

On top of that markers for the starting and ending position of a comment range are not runs and are not copied when generating static paragraphs with M2Doc. Using RawCopier for this matter should help, but it will also produce new issues...