[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 7 16:20:01 UTC 2018


 sw/qa/extras/layout/data/tdf109137.docx |binary
 sw/qa/extras/layout/layout.cxx          |   20 ++++++++++++++++++++
 sw/source/core/doc/textboxhelper.cxx    |    2 ++
 3 files changed, 22 insertions(+)

New commits:
commit 510f335621db11873499751d63be6f8460c38915
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Aug 6 21:42:32 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Aug 7 18:19:40 2018 +0200

    tdf#109137 sw textbox: fix initial wrap type of a shape's textbox
    
    This was already working for the DOCX import by luck. Make the wrap type
    explicit, so the ODF import has it correctly.
    
    The wrap type for the hidden sw text frame ("textbox of a shape") should
    be always "through", wrapping is only performed for the surrounding draw
    shape.
    
    (cherry picked from commit 59f5f666a5085ae58a8dd164636a6bea47e6bddc)
    
    Conflicts:
            sw/qa/extras/layout/layout.cxx
    
    Change-Id: Ice28cd5b517d544cfab4900dee32f01b534fee26
    Reviewed-on: https://gerrit.libreoffice.org/58671
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/qa/extras/layout/data/tdf109137.docx b/sw/qa/extras/layout/data/tdf109137.docx
new file mode 100644
index 000000000000..03e2423bc155
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf109137.docx differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index f9da84956c5f..a3d0950db548 100755
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <swmodeltestbase.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <test/mtfxmldump.hxx>
 
 static char const DATA_DIRECTORY[] = "/sw/qa/extras/layout/data/";
@@ -25,6 +26,7 @@ public:
     void testTdf116848();
     void testTdf117245();
     void testTdf109077();
+    void testTdf109137();
 
     CPPUNIT_TEST_SUITE(SwLayoutWriter);
     CPPUNIT_TEST(testTdf116830);
@@ -36,6 +38,7 @@ public:
     CPPUNIT_TEST(testTdf116848);
     CPPUNIT_TEST(testTdf117245);
     CPPUNIT_TEST(testTdf109077);
+    CPPUNIT_TEST(testTdf109137);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -208,6 +211,23 @@ void SwLayoutWriter::testTdf109077()
     CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(15), nTextBoxTop - nShapeTop);
 }
 
+void SwLayoutWriter::testTdf109137()
+{
+    createDoc("tdf109137.docx");
+    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+    utl::TempFile aTempFile;
+    aTempFile.EnableKillingFile();
+    uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({
+        { "FilterName", uno::Any(OUString("writer8")) },
+    }));
+    xStorable->storeToURL(aTempFile.GetURL(), aDescriptor);
+    loadURL(aTempFile.GetURL(), "tdf109137.odt");
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    // This was 0, the blue rectangle moved from the 1st to the 2nd page.
+    assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt",
+                /*nNumberOfNodes=*/1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 3377220d98fd..4ca1ec9d4f33 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -85,6 +85,8 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape)
 
     xPropertySet->setPropertyValue(UNO_NAME_SIZE_TYPE, uno::makeAny(text::SizeType::FIX));
 
+    xPropertySet->setPropertyValue(UNO_NAME_SURROUND, uno::makeAny(text::WrapTextMode_THROUGH));
+
     uno::Reference<container::XNamed> xNamed(xTextFrame, uno::UNO_QUERY);
     xNamed->setName(pShape->GetDoc()->GetUniqueFrameName());
 


More information about the Libreoffice-commits mailing list