From c903c91aced13ae296456e54a5c90d7ca3938594 Mon Sep 17 00:00:00 2001 From: László Németh Date: Tue, 12 Jul 2022 17:53:55 +0200 Subject: tdf#149707 sw_redlinenum DOCX export: fix tracked moving of list items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: László Németh --- sw/qa/extras/ooxmlexport/data/tdf149711.docx | Bin 0 -> 13619 bytes sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 11 +++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf149711.docx 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 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf149711.docx 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 ), -- cgit