From 8431865e6b4d006f9df34663c4d81e76cccbda44 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 22 Nov 2024 19:33:52 -0500 Subject: tdf#108820 tdf#158713 sw layout: no footnote in repeated table rows This fixes my LO 7.1 regression from bug 108820. The problem was that footnotes-placed-in-table-headline were being visually removed if a split-table was ever joined during editing, etc. (i.e. one less page needed). Avoid the join() cleanup code being triggered on GetFollow frames because those were wrongly being informed that there was a footnote, despite being deliberately disallowed in IsFootnoteAllowed, so it really must not HasFootnote()! make CppunitTest_sw_core_layout \ CPPUNIT_TEST_NAME=testTdf158713_footnoteInHeadline Change-Id: I8f395217ba66a258738fc3f32846b952c69d367b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177059 Reviewed-by: Justin Luth Tested-by: Jenkins --- sw/source/core/text/txtftn.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 0cf0f266511a..84f961781232 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -797,10 +797,10 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, OSL_ENSURE( ! m_pFrame->IsVertical() || m_pFrame->IsSwapped(), "NewFootnotePortion with unswapped frame" ); - SwTextFootnote *pFootnote = static_cast(pHint); + if (!m_pFrame->IsFootnoteAllowed()) + return new SwFootnotePortion(u""_ustr, nullptr); - if( !m_pFrame->IsFootnoteAllowed() ) - return new SwFootnotePortion(u""_ustr, pFootnote); + SwTextFootnote *pFootnote = static_cast(pHint); const SwFormatFootnote& rFootnote = pFootnote->GetFootnote(); SwDoc *const pDoc = &m_pFrame->GetDoc(); @@ -1408,7 +1408,7 @@ bool SwFootnotePortion::Format( SwTextFormatInfo &rInf ) SetAscent( rInf.GetAscent() ); Height( rInf.GetTextHeight() ); rInf.SetFootnoteDone( !bFull ); - if( !bFull ) + if (!bFull && m_pFootnote) rInf.SetParaFootnote(); return bFull; } -- cgit