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

László Németh laszlo.nemeth at collabora.com
Mon Nov 9 16:03:24 PST 2015


 sw/qa/extras/uiwriter/data/tdf92648.docx |binary
 sw/qa/extras/uiwriter/uiwriter.cxx       |   17 +++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 41d90d6c7c41df781ecaf7745872f20abd7e52a9
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Tue Nov 10 01:00:51 2015 +0100

    tdf#92648 unit test for DOCX import regression (textbox shrinking)
    
    Change-Id: I810708bbd337b325ed58927fcdd67f24f70f1252

diff --git a/sw/qa/extras/uiwriter/data/tdf92648.docx b/sw/qa/extras/uiwriter/data/tdf92648.docx
new file mode 100644
index 0000000..4857723
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf92648.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8924f28..f0b495d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -167,6 +167,7 @@ public:
     void testTdf88986();
     void testTdf87922();
     void testTdf77014();
+    void testTdf92648();
 
     CPPUNIT_TEST_SUITE(SwUiWriterTest);
     CPPUNIT_TEST(testReplaceForward);
@@ -243,6 +244,7 @@ public:
     CPPUNIT_TEST(testTdf88986);
     CPPUNIT_TEST(testTdf87922);
     CPPUNIT_TEST(testTdf77014);
+    CPPUNIT_TEST(testTdf92648);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2743,6 +2745,21 @@ void SwUiWriterTest::testTdf77014()
     CPPUNIT_ASSERT_EQUAL(OUString("1"),       parseDump("/root/page/body/txt[5]/Text[5]", "nLength"));
 }
 
+void SwUiWriterTest::testTdf92648()
+{
+    SwDoc* pDoc = createDoc("tdf92648.docx");
+    SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+    std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc);
+    // Make sure we have ten draw shapes.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(10), SwTextBoxHelper::getCount(pPage, aTextBoxes));
+    // and the text boxes haven't got zero height
+    for (std::set<const SwFrameFormat*>::iterator it=aTextBoxes.begin(); it!=aTextBoxes.end(); ++it)
+    {
+        SwFormatFrmSize aSize((*it)->GetFrmSize());
+        CPPUNIT_ASSERT(aSize.GetHeight() != 0);
+    }
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 


More information about the Libreoffice-commits mailing list