| commit | 91f46dcc99f9191a00bc41a90088ffa9eb124bd8 | [log] |
|---|---|---|
| author | Michael Stahl <michael.stahl@allotropia.de> | Tue Aug 08 19:39:04 2023 +0200 |
| committer | Miklos Vajna <vmiklos@collabora.com> | Mon Aug 14 11:27:47 2023 +0200 |
| tree | d74153ee80d0e7d8232baa064e61b68ac4500787 | |
| parent | ac5d5b4d7901b347b9b610b536317b30ec785f68 [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/+/155474 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 73a4ced..820d783 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 )