summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSzabolcs Toth <szabolcs450@gmail.com>2020-06-04 15:43:42 +0200
committerLászló Németh <nemeth@numbertext.org>2020-06-23 16:20:13 +0200
commit7380905abc0833d9e4c4fe731d76174db8a8724c (patch)
treeabc818e5f2fb2884f1041e9626115e69cde766d5 /sw/qa
parent29cb36cbee9c3ff5e73bc7a6d6a2f365c5c62da7 (diff)
tdf#132976 DOCX import: fix shape width relative to left margin
using UNO API RelativeWidthRelation and the associated lo-ext attribute for OpenDocument export. See commit 43d7f4e3640c5e370fd1204739c2b0c7eb5f40e4 (offapi: document the 4 new properties which are no longer read-only). Co-authored-by: Balázs Regényi Change-Id: I2dada8ad764a1fba33d241117cc4bc5eddae74ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95525 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docxbin0 -> 14864 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx
new file mode 100644
index 000000000000..2f1c5560c17a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 336e99b26507..4c6428321792 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1155,6 +1155,20 @@ DECLARE_OOXMLEXPORT_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt")
"/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0");
}
+DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromLeftMargin, "tdf132976_testRelativeAnchorWidthFromLeftMargin.docx")
+{
+ // TODO: Fix export.
+ if (mbExported)
+ return;
+
+ // tdf#132976 The size of the width of this shape should come from the size of the left margin.
+ // It was set to the size of the width of the entire page before.
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ const sal_Int32 nAnchoredWidth
+ = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1133), nAnchoredWidth);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */