diff options
author | László Németh <nemeth@numbertext.org> | 2023-06-29 11:13:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-07-10 13:52:31 +0200 |
commit | a1f7f54202ed610da60e58d18af552ae39f5603a (patch) | |
tree | d800bf505788fb5dcc0c933215474c5b3ae0456e /sw | |
parent | 9fefa504be3e5ef28a5ef9a0dab7be7044def3c0 (diff) |
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".
(cherry picked from commit 7520349b61a74e93a1d5d992f41b60631c3c5937)
[ Miklos: also now CppunitTest_sw_core_layout would fail, so pick a
number of test document updates from commit
fc1b9ab2913bc8c2d8414b6d8de3ceed3910c5d8 (tdf#133560: re-anchor objects,
to use paragraph's dispose for bEndOfDocument, 2023-06-23) from master,
too. ]
Change-Id: I6006db3fe2b5e6f7029a8a2d5d9cf99a17ec2ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154237
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/layout/data/floattable-2cols.docx | bin | 32634 -> 31941 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-compat14-body.docx | bin | 27950 -> 27894 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-compat14-nosplit.docx | bin | 26217 -> 26165 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-compat14.docx | bin | 28479 -> 28497 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-footer-2rows.docx | bin | 32629 -> 31993 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-footer.docx | bin | 31684 -> 31661 bytes | |||
-rw-r--r-- | sw/qa/core/layout/data/floattable-widow.docx | bin | 31304 -> 31279 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 10 |
8 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/core/layout/data/floattable-2cols.docx b/sw/qa/core/layout/data/floattable-2cols.docx Binary files differindex c43779f2aac9..b55bc8dd49b8 100644 --- a/sw/qa/core/layout/data/floattable-2cols.docx +++ b/sw/qa/core/layout/data/floattable-2cols.docx diff --git a/sw/qa/core/layout/data/floattable-compat14-body.docx b/sw/qa/core/layout/data/floattable-compat14-body.docx Binary files differindex 134128348ce2..fc25b867afc9 100644 --- a/sw/qa/core/layout/data/floattable-compat14-body.docx +++ b/sw/qa/core/layout/data/floattable-compat14-body.docx diff --git a/sw/qa/core/layout/data/floattable-compat14-nosplit.docx b/sw/qa/core/layout/data/floattable-compat14-nosplit.docx Binary files differindex 7d24d95aa92f..bd3f09c69e65 100644 --- a/sw/qa/core/layout/data/floattable-compat14-nosplit.docx +++ b/sw/qa/core/layout/data/floattable-compat14-nosplit.docx diff --git a/sw/qa/core/layout/data/floattable-compat14.docx b/sw/qa/core/layout/data/floattable-compat14.docx Binary files differindex 5afb0af477d8..19221609ddee 100644 --- a/sw/qa/core/layout/data/floattable-compat14.docx +++ b/sw/qa/core/layout/data/floattable-compat14.docx diff --git a/sw/qa/core/layout/data/floattable-footer-2rows.docx b/sw/qa/core/layout/data/floattable-footer-2rows.docx Binary files differindex 72013be28fbd..0d3db047c125 100644 --- a/sw/qa/core/layout/data/floattable-footer-2rows.docx +++ b/sw/qa/core/layout/data/floattable-footer-2rows.docx diff --git a/sw/qa/core/layout/data/floattable-footer.docx b/sw/qa/core/layout/data/floattable-footer.docx Binary files differindex 52cc73b17dfb..731e4fdb23a5 100644 --- a/sw/qa/core/layout/data/floattable-footer.docx +++ b/sw/qa/core/layout/data/floattable-footer.docx diff --git a/sw/qa/core/layout/data/floattable-widow.docx b/sw/qa/core/layout/data/floattable-widow.docx Binary files differindex 4a70c942c976..c3f17e6cd9ed 100644 --- a/sw/qa/core/layout/data/floattable-widow.docx +++ b/sw/qa/core/layout/data/floattable-widow.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index c6949b14e6bc..5cc20d556853 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -1348,6 +1348,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 |