| commit | 0bfed8ac8f88f434081aa0694933419c77573b28 | [log] |
|---|---|---|
| author | Michael Stahl <michael.stahl@allotropia.de> | Tue Aug 08 19:39:04 2023 +0200 |
| committer | Xisco Fauli <xiscofauli@libreoffice.org> | Wed Aug 16 11:14:02 2023 +0200 |
| tree | 272336a8767c37a23ec6ac2f0da5fa695193dc74 | |
| parent | 0bd916a78dc9e586d78dffdf57e6fa80b955eef6 [diff] |
tdf#151866 sw: layout: prevent deleting newly created SwSectionFrame A section frame is created so that content can move back from another page into it. Apparently only the pPrv frame is on the same page, and formatting it in SwFrame::MakePos() moves it backward, then CheckPageDescs() sees a page with only empty section frames on it and deletes the whole page. (regression from commit b9ef71476fd70bc13f50ebe80390e0730d1b7afb) Change-Id: I4f8e4debd4bcf993c9355dcfc3ced779fe6732ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155467 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 2f9e67d1e70bdc45dfc59554547bc3730481a757) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155475 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 1843735..73b72d0 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx
@@ -542,6 +542,9 @@ void SwFrame::MakePos() !pPrv->GetAttrSet()->GetKeep().GetValue() ) { // tdf#151866 pPrv may MoveBwd and if this is a newly created // section frame then CheckPageDescs() may delete the whole page! SwFrameDeleteGuard g(this); // Prevent it. pPrv->Calc(getRootFrame()->GetCurrShell() ? getRootFrame()->GetCurrShell()->GetOut() : nullptr); // This may cause Prev to vanish! } else if ( pPrv->getFrameArea().Top() == 0 )