diff options
author | Andreas Martens <ama@openoffice.org> | 2001-08-17 11:22:48 +0000 |
---|---|---|
committer | Andreas Martens <ama@openoffice.org> | 2001-08-17 11:22:48 +0000 |
commit | bf4ed8c812663d74f62e65d5a9ea7aa0de7dacbc (patch) | |
tree | ea431de9272de59d3ad9bb1bd543e41f5b3c9ba0 /sw/source | |
parent | befedb83d9510fc818c79927c290140949830401 (diff) |
Fix #90885#: Working on a deleted pointer
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 23 |
2 files changed, 26 insertions, 10 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index cb6c477beb..cb0875e4d4 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: flowfrm.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: ama $ $Date: 2001-07-16 13:03:07 $ + * last change: $Author: ama $ $Date: 2001-08-17 12:22:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -417,12 +417,14 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart ) } if ( pLay->IsFtnFrm() ) - { if ( !pLay->Lower() && !pLay->IsColLocked() ) + { if ( !pLay->Lower() && !pLay->IsColLocked() && + !((SwFtnFrm*)pLay)->IsBackMoveLocked() ) { pLay->Cut(); delete pLay; } else - { ((SwFtnFrm*)pLay)->LockBackMove(); + { BOOL bUnlock = !((SwFtnFrm*)pLay)->IsBackMoveLocked(); + ((SwFtnFrm*)pLay)->LockBackMove(); pLay->InvalidateSize(); pLay->Calc(); SwCntntFrm *pCnt = pLay->ContainsCntnt(); @@ -438,7 +440,8 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart ) pCnt->Calc(); pCnt = pCnt->GetNextCntntFrm(); } - ((SwFtnFrm*)pLay)->UnlockBackMove(); + if( bUnlock ) + ((SwFtnFrm*)pLay)->UnlockBackMove(); } pLay = 0; } diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index a4f77053eb..2574c9865c 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ftnfrm.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2001-04-26 12:12:54 $ + * last change: $Author: ama $ $Date: 2001-08-17 12:22:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2247,6 +2247,7 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc ) { SwTxtFtn *pAttr = pFtn->GetAttr(); pCnt = pFtn->ContainsAny(); + BOOL bUnlock = !pFtn->IsBackMoveLocked(); pFtn->LockBackMove(); while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr ) @@ -2265,7 +2266,15 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc ) else pCnt = pCnt->FindNext(); } - pFtn->UnlockBackMove(); + if( bUnlock ) + { + pFtn->UnlockBackMove(); + if( !pFtn->ContainsAny() && !pFtn->IsColLocked() ) + { + pFtn->Cut(); + delete pFtn; + } + } } } else @@ -2348,10 +2357,12 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock, SwFrm* pCntnt = pFirst->ContainsAny(); if( pCntnt ) { + BOOL bUnlock = !pFirst->IsBackMoveLocked(); pFirst->LockBackMove(); pFirst->Calc(); pCntnt->Calc(); - pFirst->UnlockBackMove(); + if( bUnlock ) + pFirst->UnlockBackMove(); } pFtn = FindFirstFtn(); } @@ -2374,10 +2385,12 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock, SwFtnFrm* pTmp = pCnt->FindFtnFrm(); if ( bLock ) { + BOOL bUnlock = !pTmp->IsBackMoveLocked(); pTmp->LockBackMove(); pTmp->Calc(); pCnt->Calc(); - pTmp->UnlockBackMove(); + if( bUnlock ) + pTmp->UnlockBackMove(); } else { |