sw/source/core/draw/dcontact.cxx | 2 +- sw/source/core/inc/frame.hxx | 3 +++ sw/source/core/layout/ssfrm.cxx | 2 ++ sw/source/core/layout/wsfrm.cxx | 1 + 4 files changed, 7 insertions(+), 1 deletion(-)
New commits: commit 4970d562b65d06790b816ff65daef890a7619446 Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Aug 22 17:37:15 2014 +0200 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 diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index ed56e91..1eec8a3 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 0d9ac84..2f0a19c 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 e1cb418..4abedc5 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 f62a056..3261ff6 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 ), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits