diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-14 15:22:58 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-10-10 22:32:53 +0200 |
commit | 24b30c4cc9bbf11f06145ffe82b257fb2d3b4d24 (patch) | |
tree | ab2bcea84831d4eac965bccf4e19b5df509f53ce | |
parent | 2b05856974d556a2cec0f5edf2e88f2311a8f242 (diff) |
tdf#117086 crash on deleted SwFootnoteBossFrame
use SwFrameDeleteGuard to lock pOldBoss to exist over the range
its directly accessed
Change-Id: I68af80114a380f68b86cbc78278fb9e5e87cccce
Reviewed-on: https://gerrit.libreoffice.org/59113
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 78b78e61b8e9..99f4a1dbbecc 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1855,6 +1855,8 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) } } + std::unique_ptr<SwFrameDeleteGuard> xDeleteGuard(bMakePage ? new SwFrameDeleteGuard(pOldBoss) : nullptr); + bool bSamePage = true; SwLayoutFrame *pNewUpper = m_rThis.GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, true ); @@ -1893,6 +1895,8 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) pOldBoss = pOldBoss->FindFootnoteBossFrame( true ); SwPageFrame* pNewPage = pOldPage; + xDeleteGuard.reset(); + // First, we move the footnotes. bool bFootnoteMoved = false; |