diff options
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r-- | sw/source/core/layout/anchoredobject.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index ab4a193a5673..77cf548f6428 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -107,8 +107,18 @@ SwAnchoredObject::SwAnchoredObject() : { } +void SwAnchoredObject::ClearVertPosOrientFrm() +{ + if (mpVertPosOrientFrm) + { + const_cast<SwLayoutFrm*>(mpVertPosOrientFrm)->ClearVertPosOrientFrmFor(this); + mpVertPosOrientFrm = NULL; + } +} + SwAnchoredObject::~SwAnchoredObject() { + ClearVertPosOrientFrm(); } // ============================================================================= @@ -238,6 +248,8 @@ void SwAnchoredObject::SetVertPosOrientFrm( const SwLayoutFrm& _rVertPosOrientFr { mpVertPosOrientFrm = &_rVertPosOrientFrm; + const_cast<SwLayoutFrm*>(mpVertPosOrientFrm)->SetVertPosOrientFrmFor(this); + // #i28701# - take over functionality of deleted method // <SwFlyAtCntFrm::AssertPage()>: assure for at-paragraph and at-character // an anchored object, that it is registered at the correct page frame diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 4ae962ef751b..1fc5ff0fdcf3 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -557,6 +557,14 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode ) void SwLayoutFrm::Destroy() { + while (!aVertPosOrientFrmsFor.empty()) + { + SwAnchoredObject *pObj = *aVertPosOrientFrmsFor.begin(); + pObj->ClearVertPosOrientFrm(); + } + + assert(aVertPosOrientFrmsFor.empty()); + SwFrm *pFrm = pLower; if( GetFmt() && !GetFmt()->GetDoc()->IsInDtor() ) |