summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/frame.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-27 12:36:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-04-27 15:59:33 +0200
commit0a6ca96436312acfe9a44d005c9a5c42697b8c2f (patch)
tree1013eda6c623185da02686e62ffd12d8e079040b /sw/source/core/inc/frame.hxx
parent09530aec3c0687df316704eec96b3e2a96b1d804 (diff)
forcepoint#93 fix crash on layout of specific rtf
Change-Id: Id81729de2efd6f65f1b51bdb437ca21a260eaf6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132143 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/inc/frame.hxx')
-rw-r--r--sw/source/core/inc/frame.hxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 1d43850c7e9a..7cb9dffc27bc 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -443,7 +443,7 @@ protected:
bool mbColLocked : 1; // lock Grow/Shrink for column-wise section
// or fly frames, will be set in Format
bool m_isInDestroy : 1;
- bool mbForbidDelete : 1;
+ int mnForbidDelete;
void ColLock() { mbColLocked = true; }
void ColUnlock() { mbColLocked = false; }
@@ -884,7 +884,7 @@ public:
bool IsProtected() const;
bool IsColLocked() const { return mbColLocked; }
- virtual bool IsDeleteForbidden() const { return mbForbidDelete; }
+ virtual bool IsDeleteForbidden() const { return mnForbidDelete > 0; }
/// this is the only way to delete a SwFrame instance
static void DestroyFrame(SwFrame *const pFrame);
@@ -924,8 +924,8 @@ public:
void RegisterToFormat( SwFormat& rFormat );
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
- void ForbidDelete() { mbForbidDelete = true; }
- void AllowDelete() { mbForbidDelete = false; }
+ void ForbidDelete() { ++mnForbidDelete; }
+ void AllowDelete() { assert(mnForbidDelete > 0); --mnForbidDelete; }
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
bool supportsFullDrawingLayerFillAttributeSet() const;
@@ -1262,8 +1262,7 @@ public:
//it in e.g. SwSectionFrame::MergeNext etc because we will need it
//again after the SwFrameDeleteGuard dtor
explicit SwFrameDeleteGuard(SwFrame* pFrame)
- : m_pForbidFrame((pFrame && !pFrame->IsDeleteForbidden()) ?
- pFrame : nullptr)
+ : m_pForbidFrame(pFrame)
{
if (m_pForbidFrame)
m_pForbidFrame->ForbidDelete();