summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-07-12 17:53:55 +0200
committerLászló Németh <nemeth@numbertext.org>2022-07-12 19:24:37 +0200
commitc903c91aced13ae296456e54a5c90d7ca3938594 (patch)
tree9696c59a21147cd25f9dadb0bbc09160544cbce5
parent25446db3a951549492fba19fecb54c9347dd18ae (diff)
tdf#149707 sw_redlinenum DOCX export: fix tracked moving of list items
Change tracking of the paragraph mark of moved list items wasn't exported. I.e. moveFrom and moveTo paragraphs are exported as old paragraphs with new content, e.g. accepting a removed list item and rejecting an inserted list item leave empty list items instead removing the list items completely in MSO. Note: in Writer the import of the old (incomplete) DOCX export worked before this commit, too. Change-Id: I9367d880af16aab376178ab6d226b3013688997c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137005 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf149711.docxbin0 -> 13619 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx11
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
3 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf149711.docx b/sw/qa/extras/ooxmlexport/data/tdf149711.docx
new file mode 100644
index 000000000000..d90efa7c1f88
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf149711.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 308610a7c4db..5573a1b1adf2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -1374,6 +1374,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149708)
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:ins");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf149707)
+{
+ loadAndSave("tdf149711.docx");
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveFrom");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:moveTo");
+ // These were missing
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:moveFrom");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:moveTo");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf70234)
{
loadAndSave("tdf70234.docx");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 34760189fa09..a3a91a77827e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2973,6 +2973,8 @@ void DocxAttributeOutput::InitCollectedRunProperties()
FSNS( XML_w, XML_rPrChange ),
FSNS( XML_w, XML_del ),
FSNS( XML_w, XML_ins ),
+ FSNS( XML_w, XML_moveFrom ),
+ FSNS( XML_w, XML_moveTo ),
FSNS( XML_w14, XML_glow ),
FSNS( XML_w14, XML_shadow ),
FSNS( XML_w14, XML_reflection ),