diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-10 16:54:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-11 12:57:29 +0000 |
commit | 0b8e2e5efe20519e8b5563314bac0cbb84a3b967 (patch) | |
tree | 40d280961f4f5fe1177943833982d70ec64d72f1 /svx | |
parent | ae5013c566e85c49b934d624cacf95049f02d85f (diff) |
correctly dispose to avoid cyclic dependencies
accessibility cruft is still listening to dead tables so crashes in
slidesorting in main panel if moved slide has tables in it after visiting slide
sorter once.
Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/table/svdotable.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 1cc828e2fd6c..9009aa6aede5 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -266,9 +266,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n mpTableObj = pTable; mxTable = new TableModel( pTable ); mxTable->init( nColumns, nRows ); - mpLayouter = new TableLayouter( mxTable ); Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); mxTable->addModifyListener( xListener ); + mpLayouter = new TableLayouter( mxTable ); LayoutTable( mpTableObj->aRect, true, true ); mpTableObj->maLogicRect = mpTableObj->aRect; } @@ -279,6 +279,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) { if (this != &rSource) { + disconnectTableStyle(); + if( mpLayouter ) { delete mpLayouter; @@ -303,6 +305,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) ApplyCellStyles(); mpTableObj->aRect = mpTableObj->maLogicRect; LayoutTable( mpTableObj->aRect, false, false ); + + connectTableStyle(); } return *this; } @@ -449,8 +453,22 @@ bool SdrTableObjImpl::ApplyCellStyles() void SdrTableObjImpl::dispose() { + disconnectTableStyle(); + mxTableStyle.clear(); + + if( mpLayouter ) + { + delete mpLayouter; + mpLayouter = 0; + } + if( mxTable.is() ) + { + Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); + mxTable->removeModifyListener( xListener ); mxTable->dispose(); + mxTable.clear(); + } } // ----------------------------------------------------------------------------- |