diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-08-22 17:37:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-08-22 17:37:15 +0200 |
commit | 4970d562b65d06790b816ff65daef890a7619446 (patch) | |
tree | e31a37429ad132e50024e007a5d89378b3262690 /sw | |
parent | 3f89eccf7e4a0a398a02624e2478de805723f92b (diff) |
Prevent downcast to SwTxtFrm when already in ~SwFrm superclass dtor
...as done in SwAnchoredObject::FindAnchorCharFrm
(sw/source/core/layout/anchoredobject.cxx) during CppunitTest_sw_ooxmlexport5:
SwAnchoredObject::FindAnchorCharFrm
SwAnchoredObject::GetAnchorFrmContainingAnchPos
SwAnchoredObject::FindPageFrmOfAnchor
lcl_NotifyBackgroundOfObj
SwDrawContact::DisconnectFromLayout
SwDrawContact::DisconnectObjFromLayout
SwFrm::Destroy
SwFrm::~SwFrm
SwCntntFrm::~SwCntntFrm
SwTxtFrm::~SwTxtFrm
SwTxtFrm::~SwTxtFrm
SwLayoutFrm::Destroy
SwLayoutFrm::~SwLayoutFrm
SwCellFrm::~SwCellFrm
SwCellFrm::~SwCellFrm
SwLayoutFrm::Destroy
SwLayoutFrm::~SwLayoutFrm
SwRowFrm::~SwRowFrm
SwRowFrm::~SwRowFrm
SwLayoutFrm::Destroy
SwLayoutFrm::~SwLayoutFrm
SwTabFrm::~SwTabFrm
SwTabFrm::~SwTabFrm
SwFlyFrm::DeleteCnt
SwFlyFrm::~SwFlyFrm
SwFlyFreeFrm::~SwFlyFreeFrm
SwFlyAtCntFrm::~SwFlyAtCntFrm
SwFlyAtCntFrm::~SwFlyAtCntFrm
SwLayoutFrm::Destroy
SwLayoutFrm::~SwLayoutFrm
SwBodyFrm::~SwBodyFrm
SwBodyFrm::~SwBodyFrm
SwLayoutFrm::Destroy
SwLayoutFrm::~SwLayoutFrm
SwFtnBossFrm::~SwFtnBossFrm
SwPageFrm::~SwPageFrm
SwPageFrm::~SwPageFrm
SwLayoutFrm::Destroy
SwRootFrm::~SwRootFrm
SwRootFrm::~SwRootFrm
boost::checked_delete<SwRootFrm>
boost::detail::sp_counted_impl_p<SwRootFrm>::dispose
boost::detail::sp_counted_base::release
boost::detail::shared_count::~shared_count
boost::shared_ptr<SwRootFrm>::~shared_ptr
SwViewShell::~SwViewShell
SwCrsrShell::~SwCrsrShell
SwEditShell::~SwEditShell
SwFEShell::~SwFEShell
SwWrtShell::~SwWrtShell
SwWrtShell::~SwWrtShell
SwView::~SwView
SwView::~SwView
SfxViewFrame::ReleaseObjectShell_Impl
SfxViewFrame::~SfxViewFrame
SfxViewFrame::~SfxViewFrame
SfxViewFrame::Close
SfxFrame::DoClose_Impl
SfxBaseController::dispose
(anonymous namespace)::Frame::setComponent
(anonymous namespace)::Frame::close
SfxFrame::DoClose
SfxViewFrame::Notify
SfxBroadcaster::Broadcast
SfxModelListener_Impl::notifyClosing
SfxBaseModel::close
SwXTextDocument::close
SfxBaseModel::dispose
SwXTextDocument::dispose
SwModelTestBase::tearDown
...
Change-Id: I4c00fa8eebf0346a2bad81a9e362cd901555bbf0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/frame.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index ed56e91f5c7a..1eec8a3beb8f 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1597,7 +1597,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer ) // --> #i36181# - notify background of drawing object if ( _bMoveMasterToInvisibleLayer && !(GetFmt()->GetDoc()->IsInDtor()) && - GetAnchorFrm() ) + GetAnchorFrm() && !GetAnchorFrm()->IsInDtor() ) { const Rectangle aOldRect( maAnchoredDrawObj.GetObjRectWithSpaces().SVRect() ); lcl_NotifyBackgroundOfObj( *this, *GetMaster(), &aOldRect ); diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 0d9ac844d82b..2f0a19c53b5b 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -260,6 +260,7 @@ class SwFrm: public SwClient, public SfxBroadcaster static SwCache *mpCache; bool mbIfAccTableShouldDisposing; + bool mbInDtor; // #i65250# // frame ID is now in general available - used for layout loop control @@ -846,6 +847,8 @@ public: virtual ~SwFrm(); + bool IsInDtor() const { return mbInDtor; } + // No inline cause we need the function pointers long GetTopMargin() const; long GetBottomMargin() const; diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index e1cb41803a5e..4abedc54294f 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -338,6 +338,8 @@ Point SwFrm::GetFrmAnchorPos( bool bIgnoreFlysAnchoredAtThisFrame ) const void SwFrm::Destroy() { + mbInDtor = true; + // accessible objects for fly and cell frames have been already disposed // by the destructors of the derived classes. if( IsAccessibleFrm() && !(IsFlyFrm() || IsCellFrm()) && GetDep() ) diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index f62a056fc05d..3261ff6e1385 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -71,6 +71,7 @@ using namespace ::com::sun::star; SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) : SwClient( pMod ), mbIfAccTableShouldDisposing( false ), //A member to identify if the acc table should dispose + mbInDtor(false), mnFrmId( SwFrm::mnLastFrmId++ ), mpRoot( pSib ? pSib->getRootFrm() : 0 ), mpUpper( 0 ), |