oox/source/vml/vmlshape.cxx                                          |    4 +++
 sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx                           |   13 
++++++++++
 3 files changed, 17 insertions(+)

New commits:
commit c3401667f5b09abde56211653bdbad2218da90fa
Author:     Regényi Balázs <regenyi.balazsmik...@nisz.hu>
AuthorDate: Sat Aug 29 09:11:46 2020 +0200
Commit:     Gabor Kelemen <kelemen.gab...@nisz.hu>
CommitDate: Wed Jan 6 15:46:02 2021 +0100

    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 <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 0d773f0b07798a59f7cf31207813aaf6bc9bb922)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108869
    Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu>

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index a7a0c46d6204..4ac378e377fa 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -788,6 +788,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
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf97618_testVmlShapeTextWordWrap.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index e3f8e6cafc57..3a6d3e9db1bc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1183,6 +1183,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108505, 
"tdf108505.docx")
         getProperty<OUString>(xText, "CharFontName"));
 }
 
+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: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to