sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 7520349b61a74e93a1d5d992f41b60631c3c5937
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Thu Jun 29 11:13:28 2023 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Thu Jun 29 23:18:44 2023 +0200

    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 <nem...@numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 204ab670dd6a..5edb4dcdcd11 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
 

Reply via email to