From b6f42a6006dd0b0e42348888ed5e0f536b7f4d8a Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 10 May 2024 08:07:41 +0200 Subject: tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once continuous endnotes are in a section, this failed, even if the generated layout is an improvement. The layout will put the endnotes to a section, which will be directly after the end of the body text, which is closer to what Word does, but makes the test fail, since the foot/endnote container is no longer directly under the page frame (the new tree is page -> body -> section -> column -> ftncont). Fix the problem by relaxing the assert to only check which pages have footnote containers, which passes with and without the move to section-based continuous endnotes, but still fails if endnotes go to their own page, which was the original problem to be tested (endnotes remained on page 3 and didn't move backwards). The assert for the number of pages can remain unchanged. (cherry picked from commit ab3416cad1dd4e706432f9b1a3592cec823c76b0) Change-Id: I9a46803463c82dac317c303721de30fae48c6924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167579 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice --- sw/qa/core/layout/layout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 5971e870304d..9cae825b38b4 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -179,9 +179,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards) // - Expected: 0 // - Actual : 1 // i.e. there were unexpected endnotes on page 1. - assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0); + assertXPath(pLayout, "/root/page[1]//ftncont"_ostr, 0); // All endnotes are in a container on page 2. - assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1); + assertXPath(pLayout, "/root/page[2]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph) -- cgit