summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/table/svdotable.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 994076e4f322..9c5e64ae677a 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();
+ }
}
// -----------------------------------------------------------------------------