sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary
sw/qa/extras/layout/layout.cxx |9 +
sw/source/core/layout/findfrm.cxx |3 ++-
3 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 76ff5c9dc5a4525067da3de485ac9d0924ab6172
Author: Attila Szűcs
AuthorDate: Mon Feb 14 08:43:08 2022 +0100
Commit: Christian Lohmaier
CommitDate: Wed Feb 23 12:49:37 2022 +0100
tdf#146704 sw: fix regression of endnote layout in sections
Endnotes collected at the end of sections moved to a new page.
Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88
"tdf#139336 sw: fix extra pages of multicolumn sections with footnotes".
Co-authored-by: Tibor Nagy (NISZ)
Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896
Tested-by: László Németh
Reviewed-by: László Németh
(cherry picked from commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129936
Tested-by: Jenkins
(cherry picked from commit dbfa2662a6d9a9b53f95198313374f5529978836)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129941
Reviewed-by: Michael Stahl
Reviewed-by: Xisco Fauli
Reviewed-by: Christian Lohmaier
Tested-by: Christian Lohmaier
diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt
b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt
new file mode 100644
index ..660dcb70df0b
Binary files /dev/null and
b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 3ef61970f5ae..85a685ff2b44 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3719,6 +3719,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035)
CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY,
"tdf146704_EndnoteInSection.odt");
+CPPUNIT_ASSERT(pDoc);
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// Without the fix, the endnote placed to 2. page
+assertXPath(pXmlDoc, "/root/page", 1);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter,
testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage)
{
SwDoc* pDoc
diff --git a/sw/source/core/layout/findfrm.cxx
b/sw/source/core/layout/findfrm.cxx
index 445d3e29dcd6..d100e24526a4 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool
bFootnotes )
// similar case can be reached with a page break + FootnoteAtEnd
setting
SwSectionFrame* pSectframe = pRet->FindSctFrame();
bool bMoveToPageFrame = false;
+// tdf146704: only if it is really a footnote, not an endnote.
// tdf54465: compatibility flag to make old odt files keep these full page
sections.
-if (pSectframe
+if (bFootnotes && pSectframe
&& pSectframe->GetFormat()->getIDocumentSettingAccess().get(
DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND))
{