summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-10 16:54:59 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-16 08:36:20 +0000
commita3f38bdaaff91abdf2e0f01d0b6370aa958e4a20 (patch)
tree3b37a84dfad479cbacbc199e67adea9b5e816149 /svx/source
parentcc6ce861fe67be93cb14c6c142fabeeffd1fdcd9 (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. (cherry picked from commit 0b8e2e5efe20519e8b5563314bac0cbb84a3b967) Conflicts: svx/source/table/svdotable.cxx Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9 Reviewed-on: https://gerrit.libreoffice.org/7051 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx/source')
-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 bed3988c7c81..474d42d1ca61 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -268,9 +268,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 );
UpdateWritingMode();
LayoutTable( mpTableObj->aRect, true, true );
mpTableObj->maLogicRect = mpTableObj->aRect;
@@ -282,6 +282,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
{
if (this != &rSource)
{
+ disconnectTableStyle();
+
if( mpLayouter )
{
delete mpLayouter;
@@ -307,6 +309,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
ApplyCellStyles();
mpTableObj->aRect = mpTableObj->maLogicRect;
LayoutTable( mpTableObj->aRect, false, false );
+
+ connectTableStyle();
}
return *this;
}
@@ -453,8 +457,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();
+ }
}
// -----------------------------------------------------------------------------