sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt |binary sw/qa/extras/odfexport/odfexport2.cxx | 14 ++++++++++++++ 2 files changed, 14 insertions(+)
New commits: commit c9639186c8a6bf594fae459b4aab478bbac8fb91 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Tue Aug 31 14:51:48 2021 +0200 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Tue Aug 31 17:47:55 2021 +0200 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_l...@sil.org> diff --git a/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt b/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt new file mode 100644 index 000000000000..c2de181f1119 Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf143793_noBodyWrapping.odt differ 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"));