summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/layout/data/tdf130088.docxbin0 -> 16961 bytes
-rw-r--r--sw/qa/extras/layout/layout3.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf130088.docx b/sw/qa/extras/layout/data/tdf130088.docx
new file mode 100644
index 000000000000..8d5a7a604b5e
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf130088.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index b390e6e38b9c..11a9c0191d24 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -172,6 +172,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128966)
xmlXPathFreeObject(pXmlObj);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119908)
+{
+ createSwDoc("tdf130088.docx");
+ // Ensure that all text portions are calculated before testing.
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwViewShell* pViewShell
+ = pTextDoc->GetDocShell()->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell();
+ CPPUNIT_ASSERT(pViewShell);
+ pViewShell->Reformat();
+
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // Keep real width of the exceeding line portions to calculate shrinking
+ sal_Int32 nPortionWidth
+ = getXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]",
+ "width")
+ .toInt32();
+ // This was 5806 (not real portion width, but stripped to the line width)
+ CPPUNIT_ASSERT_GREATER(sal_Int32(5840), nPortionWidth);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234)
{
createSwDoc("tdf106234.fodt");