tdf#146346 fix unit test & extend it to empty multi-page footnote
Implementing multi-page floating tables resulted a partial
regression here: not last table of the footnote, but empty
paragraph under it resulted an empty split footnote on the
second page, without noticing the problem.
Problem with the previous unit test of tdf#146346 was
reported by Mike Kaganski: "using getPages, does *not*
fail when there are two pages - because getPages is
(problematically) implemented as jumping to the end of
the document (body!), and texting which page is this; and
for the original problem, only a part of footnotes moved
to the second page, while all the body text was on the page 1."
Add unit test to catch the original problem (all tables of the
footnote must be on the first page), which fix likely wasn't
tested correctly using only getPages(), also add a (disabled) test
for the new regression, too.
Follow-up to commit d1ac8df139a2a65db45d1970ccc0b80e17d827f6
"tdf#146346 DOCX import: fix table margins in footnotes".
Change-Id: I6006db3fe2b5e6f7029a8a2d5d9cf99a17ec2ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153739
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit e7bf166deb379d8a73bf4421a04abd2ef05ff5fc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153758
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 204ab67..5edb4dc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1358,6 +1358,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146346, "tdf146346.docx")
{
// This was 2 (by bad docDefault vertical margins around tables in footnotes)
CPPUNIT_ASSERT_EQUAL(1, getPages());
// only first page has table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// check first page: all tables on the first page
assertXPath(pXmlDoc, "/root/page[1]//anchored/fly", 8);
assertXPath(pXmlDoc, "/root/page[1]//anchored/fly/tab", 8);
// FIXME no second page (regression since multi-page floating tables?)
//assertXPath(pXmlDoc, "/root/page[2]", 0);
}
#endif