summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 675e6cc1530b..4ea139ee0c3d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -177,6 +177,7 @@ public:
void testTdf77014();
void testTdf92648();
void testTdf96515();
+ void testTdf96536();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -260,6 +261,7 @@ public:
CPPUNIT_TEST(testTdf77014);
CPPUNIT_TEST(testTdf92648);
CPPUNIT_TEST(testTdf96515);
+ CPPUNIT_TEST(testTdf96536);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2941,6 +2943,29 @@ void SwUiWriterTest::testTdf96515()
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+void SwUiWriterTest::testTdf96536()
+{
+ // Enable hide whitespace mode.
+ SwDoc* pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ SwViewOption aViewOptions(*pWrtShell->GetViewOptions());
+ aViewOptions.SetHideWhitespaceMode(true);
+ pWrtShell->ApplyViewOptions(aViewOptions);
+
+ // Insert a new paragraph at the end of the document, and then delete it.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XParagraphAppend> xParagraphAppend(xTextDocument->getText(), uno::UNO_QUERY);
+ xParagraphAppend->finishParagraph(uno::Sequence<beans::PropertyValue>());
+ calcLayout();
+ uno::Reference<lang::XComponent> xParagraph(getParagraph(2), uno::UNO_QUERY);
+ xParagraph->dispose();
+ calcLayout();
+
+ // This was 552, page did not shrink after deleting the second paragraph.
+ // 276 is 12pt font size + default line spacing (15%).
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(276), parseDump("/root/infos/bounds", "height").toInt32());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();