sw/qa/extras/ooxmlexport/data/tdf149708.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx   |   15 +++++++++++++--
 sw/source/filter/ww8/docxattributeoutput.cxx |    1 +
 3 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit d5bf3d8dfe51aa6791fd88e62fc542d888aa05c7
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Tue Jul 5 19:11:10 2022 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Wed Jul 6 12:38:21 2022 +0200

    tdf#149708 sw_redlinenum DOCX export: track inserted list items
    
    Change tracking of the paragraph mark of an inserted list item
    wasn't exported. I.e. a new list item was exported as an old
    empty list item with new tracked text content. It was loaded
    with bad actual/original numbering, and rejection of the
    incomplete insertion left an empty list item in the list instead
    of removing that list item completely.
    
    Note: the problem was inherited from OOo.
    
    See also commit 508ed558948353a3eb8be9adf3588368e440f4cf
    "tdf#115524 sw_redlinenum: show original numbering of insertions"
    and commit 4e5f89d2d3511b6421b388ecaba2f61ada14d084
    "tdf#119848 DOCX export: keep tracked deleted empty line".
    
    Change-Id: I869ba2f39749e188015f7c7371e5caf1d39060f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136838
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf149708.docx 
b/sw/qa/extras/ooxmlexport/data/tdf149708.docx
new file mode 100644
index 000000000000..5eee4a124ff7
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149708.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 24fc6d7f7995..308610a7c4db 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -1365,6 +1365,15 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTrackChangesEmptyParagraphsInADeletion)
                     "/w:document/w:body/w:p[" + OString::number(i) + 
"]/w:pPr/w:rPr/w:del");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf149708)
+{
+    loadAndSave("tdf149708.docx");
+    xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+    // keep tracked insertion of a list item
+    // This was 0 (missing tracked insertion of the paragraph mark)
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:ins");
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf70234)
 {
     loadAndSave("tdf70234.docx");
@@ -1499,8 +1508,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128156)
 {
     loadAndSave("tdf128156.docx");
     xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-    // import change tracking in frames
-    assertXPath(pXmlDoc, "//w:ins");
+    // keep tracked insertion of a paragraph
+    // This was 0 before 350972a8bffc1a74b531e0336954bf54b1356025,
+    // and 1 later (missing tracked insertion of the paragraph mark)
+    assertXPath(pXmlDoc, "//w:ins", 2);
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf125546)
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3923f0ac7b63..34760189fa09 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2972,6 +2972,7 @@ void DocxAttributeOutput::InitCollectedRunProperties()
         FSNS( XML_w, XML_oMath ),
         FSNS( XML_w, XML_rPrChange ),
         FSNS( XML_w, XML_del ),
+        FSNS( XML_w, XML_ins ),
         FSNS( XML_w14, XML_glow ),
         FSNS( XML_w14, XML_shadow ),
         FSNS( XML_w14, XML_reflection ),

Reply via email to