summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-11-10 01:00:51 +0100
committerLászló Németh <laszlo.nemeth@collabora.com>2015-11-10 01:02:49 +0100
commit41d90d6c7c41df781ecaf7745872f20abd7e52a9 (patch)
tree30f31bae5eacb746425be74ec5ea3f15567780ba
parent6540c288372c3cbb94a30daa5a40e97690cb0ea5 (diff)
tdf#92648 unit test for DOCX import regression (textbox shrinking)
Change-Id: I810708bbd337b325ed58927fcdd67f24f70f1252
-rw-r--r--sw/qa/extras/uiwriter/data/tdf92648.docxbin0 -> 70406 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf92648.docx b/sw/qa/extras/uiwriter/data/tdf92648.docx
new file mode 100644
index 000000000000..4857723d35c0
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf92648.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8924f28056ab..f0b495d37c5b 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();