[Libreoffice-commits] core.git: oox/source sw/qa

Regényi Balázs (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 29 10:25:39 UTC 2020


 oox/source/shape/WpsContext.cxx                       |    5 +++++
 sw/qa/extras/ooxmlexport/data/tdf80526_word_wrap.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx            |   10 ++++++++++
 3 files changed, 15 insertions(+)

New commits:
commit 61291a63c0f9a57064300e7afc8222b4ae4e155a
Author:     Regényi Balázs <regenyi.balazs at nisz.hu>
AuthorDate: Mon Sep 21 15:20:25 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Tue Sep 29 12:25:07 2020 +0200

    tdf#80526 DOCX: import word-wrap textbox setting
    
    See option "Word wrap text in shape" in Format->Text Box
    and Shape->Text Attributes... of the selected textbox.
    
    Co-authored-by: Szabolcs Toth
    
    Change-Id: I7f2ca392089043c4bec20b943aa8c1975de72e5f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103109
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 076fd1124307..cb47692d4c95 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -160,6 +160,11 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
                             xTextBoxPropertySet->setPropertyValue("CharColor", xCharColor);
                     }
                 }
+
+                auto nWrappingType = rAttribs.getToken(XML_wrap, XML_square);
+                xPropertySet->setPropertyValue("TextWordWrap",
+                                               uno::makeAny(nWrappingType == XML_square));
+
                 return this;
             }
             break;
diff --git a/sw/qa/extras/ooxmlexport/data/tdf80526_word_wrap.docx b/sw/qa/extras/ooxmlexport/data/tdf80526_word_wrap.docx
new file mode 100644
index 000000000000..abf5ee5ed2c8
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf80526_word_wrap.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 682343c782af..f1934775b1c1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -1086,6 +1086,16 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131420, "tdf131420.docx")
     assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr[2]");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf80526_word_wrap, "tdf80526_word_wrap.docx")
+{
+    // tdf#80526: check whether the "wrap" property has been set
+    // TODO: fix export too
+    if (mbExported)
+        return;
+    uno::Reference<drawing::XShape> xShape = getShape(1);
+    CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xShape, "TextWordWrap"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list