summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs+gerrit@gmail.com>2020-06-25 15:15:46 +0200
committerLászló Németh <nemeth@numbertext.org>2020-07-03 13:33:16 +0200
commitcab956c480eb4f619580285c7b9a15b9e6d9b780 (patch)
tree3f93c46556d7e6a686e3d714aa3ce42edbffc27a /sw
parent7b14b4b377c1b94e4899860e1a45abd55230cdca (diff)
tdf#112312 DOCX legacy shape export: keep fixed size
Classical/legacy shapes lost their fixed size when exporting them with the option "Resize shape to fit text" because they do not have the ability to resize to content. Co-authored-by: Szabolcs Tóth Change-Id: Idd84dea040f9607d0d498e591601a8648a605a2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97127 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odtbin0 -> 11123 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt b/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt
new file mode 100644
index 000000000000..b5ccb356203e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index db5add6d8014..e89522670483 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -1269,6 +1269,18 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_test
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2408), nAnchoredWidth);
}
+DECLARE_OOXMLEXPORT_TEST(testAutoFitForLegacyShapes, "tdf112312_AutoFitForLegacyShapes.odt")
+{
+ // tdf#112312: check if noAutoFit is used instead of spAutoFit even if the TextAutoGrowHeight is set
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:noAutofit");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "a:spAutofit");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */