summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-07-07 12:18:42 +0200
committerLászló Németh <nemeth@numbertext.org>2021-07-08 11:28:38 +0200
commit474e16bbb613c2ca61b8d41d1562d9b86f689851 (patch)
tree3c6c15959928c2ffdd92fcb0b43883fd38b954c2 /sw
parente170e08e009642ccdea5db490dc5dd038b45c04d (diff)
tdf#142700 DOCX: fix lost track changes of images
anchored to characters or paragraphs. Tracked deletions and insertions weren't imported, if they contain only images anchored to character, resulting loss of the document content: i.e. deleted images were reappeared, as not deleted images. Note: because change tracking of the OpenDocument and Writer supports only text range based changes, the fix is a workaround using zero width spaces to create an invisible text around the anchoring point of the images. This workaround is not used, if it's not necessary, i.e. if the image is part of a bigger deletion or insertion, which contains also text, not only an image. Change-Id: Iaae6aae2c01191512c71117a0c788a4147c4cae0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118557 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 8726cf692299ea262a7455adcf6ec25451c7869d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118612
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf142700.docxbin0 -> 18373 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf142700.docx b/sw/qa/extras/ooxmlexport/data/tdf142700.docx
new file mode 100644
index 000000000000..393e2ff4771b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf142700.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 9cfaf5aa6e6c..1864c4bcf83e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1376,6 +1376,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128913, "tdf128913.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142700, "tdf142700.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport();
+ // w:ins and w:del are imported correctly, if they contain only images anchored to character
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:anchor/a:graphic");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142387, "tdf142387.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport();