summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazsmiklos@nisz.hu>2020-08-29 09:11:46 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-31 16:04:01 +0200
commit0d773f0b07798a59f7cf31207813aaf6bc9bb922 (patch)
tree77a2efe3cd0f958f27dcc96aab983f38fb6b9bb2
parent57320af60d97f2918b5d1e73575b23682e0a0637 (diff)
tdf#97618 DOCX import: VML shape: fix missing square wrap
Co-authored-by: Szabolcs Tóth Change-Id: Ib9db4b0270ed7d4b3d47406f2384276cafdd7249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101632 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--oox/source/vml/vmlshape.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docxbin0 -> 16115 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx13
3 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 362f02c7cabf..85ad112bcfae 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -791,6 +791,10 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
eTextVerticalAdjust = drawing::TextVerticalAdjust_BOTTOM;
PropertySet(xShape).setAnyProperty(PROP_TextVerticalAdjust, makeAny(eTextVerticalAdjust));
+ // tdf#97618
+ if(!maTypeModel.maWrapStyle.isEmpty())
+ PropertySet(xShape).setAnyProperty(PROP_TextWordWrap, makeAny(maTypeModel.maWrapStyle == "square"));
+
PropertySet(xShape).setAnyProperty(PROP_TextAutoGrowHeight,
makeAny(maTypeModel.mbAutoHeight));
diff --git a/sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docx b/sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docx
new file mode 100644
index 000000000000..eb31a1244c01
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index e68dde7499e7..30a27a22e1ce 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1264,6 +1264,19 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "2551");
}
+DECLARE_OOXMLEXPORT_TEST(testVmlShapeTextWordWrap, "tdf97618_testVmlShapeTextWordWrap.docx")
+{
+ // tdf#97618 The text wraping of a shape was not handled in a canvas.
+ // TODO: fix export too
+ if (mbExported)
+ return;
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ if (!pXmlDoc)
+ return;
+ // The bound rect of shape will be wider if wrap does not work (the wrong value is 3167).
+ assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width", "2500");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */