sw/source/core/layout/ftnfrm.cxx | 14 ++++++++++++-- sw/source/core/layout/layouter.cxx | 14 +++++--------- sw/source/core/layout/tabfrm.cxx | 4 +--- 3 files changed, 18 insertions(+), 14 deletions(-)
New commits: commit ff29d8cd52ec9e15be63b61060f4b9b5b0da9b15 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Thu May 11 18:54:33 2023 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue May 16 19:07:33 2023 +0200 sw: move some loop control debug messages out of #if OSL_DEBUG_LEVEL > 1 Also convert some obvious assert(). Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151679 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 85d961200b674b8c8179f85aed752fb179350dbb) Change-Id: I6ec56920df5b4aceff5e85b7e7e40ee8ce37f93a diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx index dbb5757bbd1b..993a22b33df8 100644 --- a/sw/source/core/layout/layouter.cxx +++ b/sw/source/core/layout/layouter.cxx @@ -183,12 +183,10 @@ void SwLooping::Control( SwPageFrame* pPage ) static bool bNoLouie = false; if( bNoLouie ) return; +#endif // FME 2007-08-30 #i81146# new loop control - OSL_ENSURE( 0 != mnLoopControlStage, "Looping Louie: Stage 1!" ); - OSL_ENSURE( 1 != mnLoopControlStage, "Looping Louie: Stage 2!!" ); - OSL_ENSURE( 2 > mnLoopControlStage, "Looping Louie: Stage 3!!!" ); -#endif + SAL_WARN("sw.layout", "Looping Louie: Stage " << (mnLoopControlStage + 1) << "!"); Drastic( pPage->Lower() ); if( nNew > nMinPage && pPage->GetPrev() ) @@ -235,7 +233,7 @@ void SwLayouter::InsertEndnotes( SwSectionFrame const * pSect ) void SwLayouter::LoopControl( SwPageFrame* pPage ) { - OSL_ENSURE( mpLooping, "Looping: Lost control" ); + assert(mpLooping); mpLooping->Control( pPage ); } @@ -243,9 +241,7 @@ void SwLayouter::LoopingLouieLight( const SwDoc& rDoc, const SwTextFrame& rFrame { if ( mpLooping && mpLooping->IsLoopingLouieLight() ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_FAIL( "Looping Louie (Light): Fixating fractious frame" ); -#endif + SAL_WARN("sw.layout", "Looping Louie (Light): Fixating fractious frame"); SwLayouter::InsertMovedFwdFrame( rDoc, rFrame, rFrame.FindPageFrame()->GetPhyPageNum() ); } } @@ -289,7 +285,7 @@ bool SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrame const * pSect, SwFootno bool SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrame const *pPage ) { - OSL_ENSURE( pDoc, "No doc, no fun" ); + assert(pDoc); if( !pDoc->getIDocumentLayoutAccess().GetLayouter() ) pDoc->getIDocumentLayoutAccess().SetLayouter( new SwLayouter() ); return !pDoc->getIDocumentLayoutAccess().GetLayouter()->mpLooping && diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 54c2c8889c88..3c40df5447de 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1538,9 +1538,7 @@ bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDont continue; } -#if OSL_DEBUG_LEVEL > 1 - OSL_FAIL( "LoopControl in SwContentFrame::CalcLowers" ); -#endif + SAL_WARN("sw.layout", "LoopControl in SwContentFrame::CalcLowers"); } } if (!rDontLeave.IsAnLower(pCnt)) // moved backward? commit 3ce4b5e9077a2e77200e5e9cfe2efd033e2100dc Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Mar 8 17:36:41 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue May 16 19:07:33 2023 +0200 tdf#139687 sw: invalidate text frame in footnote when moving it The problem (which only reproduces here on copy/paste with SAL_USE_VCLPLUGIN=kf5, not with gtk3) is that on SwTextFrame 2638 in a footnote on page 19 containing "Saeed, 100–101." there should be a top margin of 0 but it's actually 144. The footnote was initially created on a previous page with another footnote with SwTextFrame 2635 before it, that's how it got this top margin. Invalidate the print area in SwFootnoteFrame::Paste(), which is called when the footnote is moved to a different container. (somehow regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48) Change-Id: I7346fd03fccad3eddccbbcd56c4b50127a337b24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131217 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 86081afc3021fa0ae6c2b32d11b4b20cc8a190a3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131201 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> (cherry picked from commit 3d8533cb894614394f1ecf05b3d6dc60f3bf6dd6) diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 280e6ed13d82..a41819058588 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -563,10 +563,20 @@ void SwFootnoteFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) if( aRectFnSet.GetWidth(getFrameArea())!=aRectFnSet.GetWidth(pParent->getFramePrintArea()) ) InvalidateSize_(); InvalidatePos_(); + if (SwFrame *const pContent = ContainsContent()) + { // tdf#139687 invalidate possibly stale top margin (computed from previous frame) + pContent->InvalidatePrt_(); + } SwPageFrame *pPage = FindPageFrame(); InvalidatePage( pPage ); - if ( GetNext() ) - GetNext()->InvalidatePos_(); + if (SwFootnoteFrame *const pNext = static_cast<SwFootnoteFrame *>(GetNext())) + { + pNext->InvalidatePos_(); + if (SwFrame *const pContent = pNext->ContainsContent()) + { // tdf#139687 invalidate possibly stale top margin (computed from previous frame) + pContent->InvalidatePrt_(); + } + } if( aRectFnSet.GetHeight(getFrameArea()) ) pParent->Grow( aRectFnSet.GetHeight(getFrameArea()) );