From 330ed8120e9881656716d70d87b9f49f861f0bfa Mon Sep 17 00:00:00 2001 From: Szabolcs Toth Date: Fri, 5 Jun 2020 12:06:22 +0200 Subject: tdf#133670 DOCX import: fix shape width relative to right margin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Ic5d25701d46cdace6502ec55dbc0e5f0ebd7742b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95582 Tested-by: László Németh Reviewed-by: László Németh --- ...df133670_testRelativeAnchorWidthFromRightMargin.docx | Bin 0 -> 14953 bytes sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx new file mode 100644 index 000000000000..68f24370a31e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 7356de7be9fe..cc5f2d3364b1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -1225,6 +1225,19 @@ DECLARE_OOXMLEXPORT_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineCo "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color"); } +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_testRelativeAnchorWidthFromRightMargin.docx") +{ + // TODO: Fix export. + if (mbExported) + return; + + // tdf#133670 The width was set relative from right margin, but this was handled relative from page width. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + const sal_Int32 nAnchoredWidth + = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast(2408), nAnchoredWidth); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit