summaryrefslogtreecommitdiffstats
path: root/sw/qa/extras/ww8export
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
commit9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch)
tree812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /sw/qa/extras/ww8export
parentReleasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff)
downloadlibreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz
libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/extras/ww8export')
-rw-r--r--sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docxbin0 -> 14534 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx
new file mode 100644
index 0000000000..3b291901f7
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index d31bf17a31..3fb0ae7b03 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -252,6 +252,30 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering)
verify();
}
+CPPUNIT_TEST_FIXTURE(Test, testDOCExportDoNotMirrorRtlDrawObjs)
+{
+ // Given a document with a shape, anchored in an RTL paragraph, loaded from DOCX:
+ createSwDoc("draw-obj-rtl-no-mirror-vml.docx");
+
+ // When saving that to DOC:
+ saveAndReload(mpFilter);
+
+ // Then make sure the shape is on the right margin:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nPageRight = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "right"_ostr).toInt32();
+ sal_Int32 nBodyRight = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "right"_ostr).toInt32();
+ sal_Int32 nShapeLeft
+ = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, "left"_ostr).toInt32();
+ CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft);
+ sal_Int32 nShapeRight
+ = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, "right"_ostr).toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected less than: 12523
+ // - Actual : 12536
+ // i.e. the shape was outside of the page right margin area, due to an unwanted mapping.
+ CPPUNIT_ASSERT_LESS(nPageRight, nShapeRight);
+}
+
DECLARE_WW8EXPORT_TEST(testNonInlinePageBreakFirstLine, "nonInlinePageBreakFirstLine.doc")
{
SwDoc* pDoc = getSwDoc();