diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-06-15 21:04:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-06-16 09:02:50 +0200 |
commit | 35bb0594b2d977312ef06fc5262cc7592bc13d0f (patch) | |
tree | 7c69b1f944b23e146dcf7b1e1bfecfa06c65d262 /sw/qa | |
parent | f1875565431d21789f12b67231fd8dc3f65e8c21 (diff) |
tdf#133145 sw ContinuousEndnotes: fix moving endnotes to a previous page
Regression from commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18
(tdf#124601 sw: add ContinuousEndnotes layout compat option,
2019-09-30), the problem was that SwFrame::GetPrevFootnoteLeaf() did not
take the new compat flag into account when determining the previous
footnote page for endnotes.
Do the same pattern here as the cases already handled in the above
commit, just try to get the "last but one" and not the "last" page,
since we try to move these endnotes to a previous page.
Change-Id: I77841a3a0fb68f054941184ee2a8aca0707d2a9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96395
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/layout/data/continuous-endnotes-move-backwards.doc | bin | 0 -> 24576 bytes | |||
-rw-r--r-- | sw/qa/core/layout/layout.cxx | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/core/layout/data/continuous-endnotes-move-backwards.doc b/sw/qa/core/layout/data/continuous-endnotes-move-backwards.doc Binary files differnew file mode 100644 index 000000000000..3ee6c56aa370 --- /dev/null +++ b/sw/qa/core/layout/data/continuous-endnotes-move-backwards.doc diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index cfc13640c471..ccf2b5cd513a 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -129,6 +129,23 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTablesMoveBackwards) assertXPath(pLayout, "//page", 1); } +CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards) +{ + // Load a document with the ContinuousEndnotes flag turned on. + load(DATA_DIRECTORY, "continuous-endnotes-move-backwards.doc"); + xmlDocUniquePtr pLayout = parseLayoutDump(); + // We have 2 pages. + assertXPath(pLayout, "/root/page", 2); + // No endnote container on page 1. + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 0 + // - Actual : 1 + // i.e. there were unexpected endnotes on page 1. + assertXPath(pLayout, "/root/page[1]/ftncont", 0); + // All endnotes are in a container on page 2. + assertXPath(pLayout, "/root/page[2]/ftncont", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |