diff options
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/layact.cxx | 11 |
4 files changed, 17 insertions, 21 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 2e925327998e..0d9bbd2be6a1 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -346,9 +346,10 @@ void SwFrm::OptPrepareMake() if ( GetUpper() && !GetUpper()->IsFooterFrm() && !GetUpper()->IsFlyFrm() ) { - ForbidDelete(); - GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); - AllowDelete(); + { + SwFrmDeleteGuard aDeleteGuard(this); + GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); + } OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." ); if ( !GetUpper() ) return; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index c78bc280a23a..2c009176fe3f 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -577,10 +577,10 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling ) bool bInvaLay; { - //JoinLock pParent for the lifetime of the Cut/Paste call to avoid - //SwSectionFrm::MergeNext removing the pParent we're trying to reparent - //into - FlowFrmJoinLockGuard aJoinGuard(pParent); + //Ensure pParent persists for the lifetime of the Cut/Paste call to + //avoid SwSectionFrm::MergeNext removing the pParent we're trying to + //reparent into + SwFrmDeleteGuard aDeleteGuard(pParent); pOldParent = CutTree( &m_rThis ); bInvaLay = PasteTree( &m_rThis, pParent, pSibling, pOldParent ); } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ff51d377f405..877e618aa582 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1463,14 +1463,10 @@ void CalcContent( SwLayoutFrm *pLay, if ( bNoCalcFollow && pFrm->IsTextFrm() ) static_cast<SwTextFrm*>(pFrm)->ForbidFollowFormat(); - const bool bDeleteForbidden(pSect && pSect->IsDeleteForbidden()); - if (pSect && !bDeleteForbidden) - pSect->ForbidDelete(); - - pFrm->Calc(pRenderContext); - - if (pSect && !bDeleteForbidden) - pSect->AllowDelete(); + { + SwFrmDeleteGuard aDeleteGuard(pSect); + pFrm->Calc(pRenderContext); + } // OD 14.03.2003 #i11760# - reset control flag for follow format. if ( pFrm->IsTextFrm() ) diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 230769f7e8b5..8dfbcbcd3308 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1223,11 +1223,10 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext); } - bool const bDeleteForbidden(pLay->IsDeleteForbidden()); - pLay->ForbidDelete(); - pLay->Calc(pRenderContext); - if (!bDeleteForbidden) - pLay->AllowDelete(); + { + SwFrmDeleteGuard aDeleteGuard(pLay); + pLay->Calc(pRenderContext); + } if ( aOldFrame != pLay->Frm() ) bChanged = true; @@ -1375,7 +1374,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, if ( pLay->IsFootnoteFrm() ) // no LayFrms as Lower return bChanged; - FlowFrmJoinLockGuard aJoinGuard(pLay); + SwFrmDeleteGuard aDeleteGuard(pLay); SwFrm *pLow = pLay->Lower(); bool bTabChanged = false; while ( pLow && pLow->GetUpper() == pLay ) |