kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0063-correctly-dispose-to-avoid-cyclic-dependencies.patch

f0633d
From a3f38bdaaff91abdf2e0f01d0b6370aa958e4a20 Mon Sep 17 00:00:00 2001
f0633d
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
f0633d
Date: Tue, 10 Dec 2013 16:54:59 +0000
f0633d
Subject: [PATCH 063/109] correctly dispose to avoid cyclic dependencies
f0633d
f0633d
accessibility cruft is still listening to dead tables so crashes in
f0633d
slidesorting in main panel if moved slide has tables in it after visiting slide
f0633d
sorter once.
f0633d
f0633d
(cherry picked from commit 0b8e2e5efe20519e8b5563314bac0cbb84a3b967)
f0633d
f0633d
Conflicts:
f0633d
	svx/source/table/svdotable.cxx
f0633d
f0633d
Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9
f0633d
Reviewed-on: https://gerrit.libreoffice.org/7051
f0633d
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
f0633d
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
f0633d
---
f0633d
 svx/source/table/svdotable.cxx | 20 +++++++++++++++++++-
f0633d
 1 file changed, 19 insertions(+), 1 deletion(-)
f0633d
f0633d
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
f0633d
index bed3988..474d42d 100644
f0633d
--- a/svx/source/table/svdotable.cxx
f0633d
+++ b/svx/source/table/svdotable.cxx
f0633d
@@ -268,9 +268,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n
f0633d
     mpTableObj = pTable;
f0633d
     mxTable = new TableModel( pTable );
f0633d
     mxTable->init( nColumns, nRows );
f0633d
-    mpLayouter = new TableLayouter( mxTable );
f0633d
     Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) );
f0633d
     mxTable->addModifyListener( xListener );
f0633d
+    mpLayouter = new TableLayouter( mxTable );
f0633d
     UpdateWritingMode();
f0633d
     LayoutTable( mpTableObj->aRect, true, true );
f0633d
     mpTableObj->maLogicRect = mpTableObj->aRect;
f0633d
@@ -282,6 +282,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
f0633d
 {
f0633d
     if (this != &rSource)
f0633d
     {
f0633d
+        disconnectTableStyle();
f0633d
+
f0633d
         if( mpLayouter )
f0633d
         {
f0633d
             delete mpLayouter;
f0633d
@@ -307,6 +309,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
f0633d
         ApplyCellStyles();
f0633d
         mpTableObj->aRect = mpTableObj->maLogicRect;
f0633d
         LayoutTable( mpTableObj->aRect, false, false );
f0633d
+
f0633d
+        connectTableStyle();
f0633d
     }
f0633d
     return *this;
f0633d
 }
f0633d
@@ -453,8 +457,22 @@ bool SdrTableObjImpl::ApplyCellStyles()
f0633d
 
f0633d
 void SdrTableObjImpl::dispose()
f0633d
 {
f0633d
+    disconnectTableStyle();
f0633d
+    mxTableStyle.clear();
f0633d
+
f0633d
+    if( mpLayouter )
f0633d
+    {
f0633d
+        delete mpLayouter;
f0633d
+        mpLayouter = 0;
f0633d
+    }
f0633d
+
f0633d
     if( mxTable.is() )
f0633d
+    {
f0633d
+        Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) );
f0633d
+        mxTable->removeModifyListener( xListener );
f0633d
         mxTable->dispose();
f0633d
+        mxTable.clear();
f0633d
+    }
f0633d
 }
f0633d
 
f0633d
 // -----------------------------------------------------------------------------
f0633d
-- 
f0633d
1.8.4.2
f0633d