summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazsmiklos@nisz.hu>2020-08-29 09:11:46 +0200
committerGabor Kelemen <kelemen.gabor2@nisz.hu>2020-10-15 11:20:50 +0200
commit846118c0be78e29752826a47cd09b3033dbd075f (patch)
treea19a2e1a346808ea0cde17817cd0b5b97e15c5f5
parent3d536594cf3ecbd5b980aaddb5cf17084b1666d4 (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> (cherry picked from commit 0d773f0b07798a59f7cf31207813aaf6bc9bb922) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104304 Tested-by: Gabor Kelemen <kelemen.gabor2@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gabor2@nisz.hu>
-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 c26d512ecd23..d4ac133718dd 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -790,6 +790,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 de2c3bb84568..29a3a3b54b5b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -503,6 +503,19 @@ DECLARE_OOXMLEXPORT_TEST(testImageSpaceSettings, "tdf135047_ImageSpaceSettings.f
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
}
+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;
+ xmlDocPtr 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: */