Kaydet (Commit) 0b8e2e5e authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst ae5013c5
...@@ -266,9 +266,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n ...@@ -266,9 +266,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n
mpTableObj = pTable; mpTableObj = pTable;
mxTable = new TableModel( pTable ); mxTable = new TableModel( pTable );
mxTable->init( nColumns, nRows ); mxTable->init( nColumns, nRows );
mpLayouter = new TableLayouter( mxTable );
Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) );
mxTable->addModifyListener( xListener ); mxTable->addModifyListener( xListener );
mpLayouter = new TableLayouter( mxTable );
LayoutTable( mpTableObj->aRect, true, true ); LayoutTable( mpTableObj->aRect, true, true );
mpTableObj->maLogicRect = mpTableObj->aRect; mpTableObj->maLogicRect = mpTableObj->aRect;
} }
...@@ -279,6 +279,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) ...@@ -279,6 +279,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
{ {
if (this != &rSource) if (this != &rSource)
{ {
disconnectTableStyle();
if( mpLayouter ) if( mpLayouter )
{ {
delete mpLayouter; delete mpLayouter;
...@@ -303,6 +305,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) ...@@ -303,6 +305,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
ApplyCellStyles(); ApplyCellStyles();
mpTableObj->aRect = mpTableObj->maLogicRect; mpTableObj->aRect = mpTableObj->maLogicRect;
LayoutTable( mpTableObj->aRect, false, false ); LayoutTable( mpTableObj->aRect, false, false );
connectTableStyle();
} }
return *this; return *this;
} }
...@@ -449,8 +453,22 @@ bool SdrTableObjImpl::ApplyCellStyles() ...@@ -449,8 +453,22 @@ bool SdrTableObjImpl::ApplyCellStyles()
void SdrTableObjImpl::dispose() void SdrTableObjImpl::dispose()
{ {
disconnectTableStyle();
mxTableStyle.clear();
if( mpLayouter )
{
delete mpLayouter;
mpLayouter = 0;
}
if( mxTable.is() ) if( mxTable.is() )
{
Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) );
mxTable->removeModifyListener( xListener );
mxTable->dispose(); mxTable->dispose();
mxTable.clear();
}
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
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