Kaydet (Commit) 4970d562 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 3f89eccf
......@@ -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 );
......
......@@ -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;
......
......@@ -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() )
......
......@@ -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 ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment