diff options
author | Justin Luth <justin_luth@sil.org> | 2021-08-31 14:51:48 +0200 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2021-08-31 17:47:55 +0200 |
commit | c9639186c8a6bf594fae459b4aab478bbac8fb91 (patch) | |
tree | 5156eb70d86104aab334c1ed928cfa1dab9b5ae4 /sw/qa | |
parent | e94c05078a7535c357bba3576d088fe53bd9eb9e (diff) |
tdf#143793 preemptive unit test for USE_FORMER_TEXT_WRAPPING
Ensure that any efforts to sort out the back-and-forth
issue of honouring wrapping in headers, footnotes, etc
won't break old documents without even a whimper.
Change-Id: Ic12595a8e25aff176e89adfaba51991d38db516c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121377
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt | bin | 0 -> 117036 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport2.cxx | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt b/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt Binary files differnew file mode 100644 index 000000000000..c2de181f1119 --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index bb73555550da..f234f2a2a88b 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -49,6 +49,20 @@ DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, "tdf104254_noHeaderWrappi CPPUNIT_ASSERT_MESSAGE("Paragraph should fit on a single line", nParaHeight < 600); } +DECLARE_ODFEXPORT_TEST(testTdf143793_noBodyWrapping, "tdf143793_noBodyWrapping.odt") +{ + // Preserve old document wrapping. Compat "Use OOo 1.1 text wrapping around objects" + // Originally, the body text did not wrap around spill-over header images + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Fits on one page", 1, getPages() ); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + sal_Int32 nParaHeight = getXPath(pXmlDoc, "//page[1]/header/txt[1]/infos/bounds", "height").toInt32(); + // The header text should wrap around the header image in OOo 1.1 and prior, + // thus taking up two lines instead of one. One line is 276. It should be 552. + CPPUNIT_ASSERT_MESSAGE("Header text should fill two lines", nParaHeight > 400); +} + DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx") { CPPUNIT_ASSERT_EQUAL(OUString(">1<"), getProperty<OUString>(getParagraph(1), "ListLabelString")); |