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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit afe9f6b33eff5d7e7bc43d185d413117cd229572)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136857
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf149708.docx b/sw/qa/extras/ooxmlexport/data/tdf149708.docx
new file mode 100644
index 0000000..5eee4a1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf149708.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 8b4fc39..3d4d393 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -1359,6 +1359,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");
@@ -1493,8 +1502,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 3923f0a..34760189 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 ),