summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-27 17:34:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-27 18:02:23 +0200
commit10d91ef984ae54eb688cbfe39acaf0f131964634 (patch)
tree2ef0c40d8b66e44fe7f39e322a33e1b2dc2bd6e1 /sw/qa/extras/uiwriter/uiwriter.cxx
parent483a4b546c850e82a2d1d304238d4830ac6b441f (diff)
SwTextBoxHelper::create: handle TextAutoGrowHeight
Without this, in case TextAutoGrowHeight is set before TextBox, the textbox of the shape won't have automatic height. Change-Id: I2ebf77eacbe1f1d10ccf64ef833c39ee965245d3
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index b279e7c9365a..47aba1ecad62 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -45,6 +45,7 @@ public:
void testShapeTextboxDelete();
void testCp1000071();
void testShapeTextboxVertadjust();
+ void testShapeTextboxAutosize();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -60,6 +61,7 @@ public:
CPPUNIT_TEST(testShapeTextboxDelete);
CPPUNIT_TEST(testCp1000071);
CPPUNIT_TEST(testShapeTextboxVertadjust);
+ CPPUNIT_TEST(testShapeTextboxAutosize);
CPPUNIT_TEST_SUITE_END();
private:
@@ -372,6 +374,22 @@ void SwUiWriterTest::testShapeTextboxVertadjust()
CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_CENTER, pFmt->GetTextVertAdjust().GetValue());
}
+void SwUiWriterTest::testShapeTextboxAutosize()
+{
+ SwDoc* pDoc = createDoc("shape-textbox-autosize.odt");
+ SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+ SdrObject* pFirst = pPage->GetObj(0);
+ CPPUNIT_ASSERT_EQUAL(OUString("1st"), pFirst->GetName());
+
+ SdrObject* pSecond = pPage->GetObj(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("2nd"), pSecond->GetName());
+
+ // Shape -> textbox synchronization was missing, the second shape had the
+ // same height as the first, even though the first contained 1 paragraph
+ // and the other 2 ones.
+ CPPUNIT_ASSERT(pFirst->GetSnapRect().getHeight() < pSecond->GetSnapRect().getHeight());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();