[Libreoffice-commits] core.git: 9 commits - chart2/source include/vcl sc/qa scripting/source sc/source sd/source svl/source svx/source sw/source test/source

Michael Stahl mstahl at redhat.com
Tue Sep 30 08:39:08 PDT 2014


 chart2/source/view/main/ChartView.cxx  |    4 +
 include/vcl/svapp.hxx                  |    8 +-
 sc/qa/extras/scannotationobj.cxx       |    3 +
 sc/qa/extras/scannotationshapeobj.cxx  |    1 
 sc/qa/extras/scannotationsobj.cxx      |    3 +
 sc/qa/extras/sccellrangeobj.cxx        |    3 +
 sc/qa/extras/scdatabaserangeobj.cxx    |    3 +
 sc/qa/extras/scdatapilotfieldobj.cxx   |    3 +
 sc/qa/extras/scdatapilottableobj.cxx   |    3 +
 sc/qa/extras/sceditfieldobj-cell.cxx   |    1 
 sc/qa/extras/sceditfieldobj-header.cxx |    1 
 sc/qa/extras/scmodelobj.cxx            |    3 +
 sc/qa/extras/scnamedrangeobj.cxx       |    3 +
 sc/qa/extras/scnamedrangesobj.cxx      |    3 +
 sc/qa/extras/scoutlineobj.cxx          |    3 +
 sc/qa/extras/scstyleloaderobj.cxx      |    6 ++
 sc/qa/extras/sctablesheetsobj.cxx      |    3 +
 sc/source/ui/unoobj/addruno.cxx        |    2 
 sc/source/ui/unoobj/cellsuno.cxx       |   14 ++++
 sc/source/ui/unoobj/chart2uno.cxx      |    6 ++
 sc/source/ui/unoobj/chartuno.cxx       |    4 +
 sc/source/ui/unoobj/confuno.cxx        |    2 
 sc/source/ui/unoobj/dapiuno.cxx        |    4 +
 sc/source/ui/unoobj/datauno.cxx        |    8 ++
 sc/source/ui/unoobj/defltuno.cxx       |    2 
 sc/source/ui/unoobj/docuno.cxx         |   16 +++++
 sc/source/ui/unoobj/drdefuno.cxx       |    2 
 sc/source/ui/unoobj/eventuno.cxx       |    2 
 sc/source/ui/unoobj/fielduno.cxx       |    2 
 sc/source/ui/unoobj/forbiuno.cxx       |    2 
 sc/source/ui/unoobj/linkuno.cxx        |   12 ++++
 sc/source/ui/unoobj/nameuno.cxx        |    8 ++
 sc/source/ui/unoobj/notesuno.cxx       |    2 
 sc/source/ui/unoobj/styleuno.cxx       |    6 ++
 sc/source/ui/unoobj/targuno.cxx        |    4 +
 sc/source/ui/unoobj/tokenuno.cxx       |    2 
 sc/source/ui/view/tabvwshh.cxx         |    2 
 scripting/source/basprov/basscript.cxx |    2 
 sd/source/ui/unoidl/unomodel.cxx       |    2 
 svl/source/notify/SfxBroadcaster.cxx   |    3 +
 svx/source/unodraw/unoshape.cxx        |    1 
 sw/source/uibase/uno/unoatxt.cxx       |    1 
 test/source/sheet/xsheetoutline.cxx    |   95 +++++++++++++++------------------
 43 files changed, 205 insertions(+), 55 deletions(-)

New commits:
commit 78f7b8f67a7765fe103dbe1ac6b0e02ff6d5939b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 17:25:10 2014 +0200

    vcl: use DBG_UTIL for additional members in SolarMutexTryAndBuyGuard
    
    ... for consistency, and to keep the ODR police away.
    
    Change-Id: Id4bf23be1e57cc29dfed9331d75034a33c2910f8

diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 64225ec..68dd3c7 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1669,7 +1669,7 @@ class SolarMutexTryAndBuyGuard
 {
     private:
         bool m_isAcquired;
-#if OSL_DEBUG_LEVEL > 0
+#ifdef DBG_UTIL
         bool m_isChecked;
 #endif
         comphelper::SolarMutex& m_rSolarMutex;
@@ -1678,7 +1678,7 @@ class SolarMutexTryAndBuyGuard
 
     SolarMutexTryAndBuyGuard()
         : m_isAcquired(false)
-#if OSL_DEBUG_LEVEL > 0
+#ifdef DBG_UTIL
         , m_isChecked(false)
 #endif
         , m_rSolarMutex(Application::GetSolarMutex())
@@ -1689,7 +1689,7 @@ class SolarMutexTryAndBuyGuard
 
     ~SolarMutexTryAndBuyGuard()
     {
-#if OSL_DEBUG_LEVEL > 0
+#ifdef DBG_UTIL
         assert(m_isChecked);
 #endif
         if (m_isAcquired)
@@ -1698,7 +1698,7 @@ class SolarMutexTryAndBuyGuard
 
     bool isAcquired()
     {
-#if OSL_DEBUG_LEVEL > 0
+#ifdef DBG_UTIL
         m_isChecked = true;
 #endif
         return m_isAcquired;
commit b98434d0170f2c1ff5b60f74d871ada81d897647
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 16:20:58 2014 +0200

    SfxBroadcaster: add some SolarMutex asserts
    
    It is extremely likely that calling SfxBroadcaster methods without
    SolarMutex lock is a bug; in case somebody finds a counterexample, this
    should be reverted.
    
    Change-Id: I4706671cfa22a3cfaed9cd33d4a77b14a57bb661

diff --git a/svl/source/notify/SfxBroadcaster.cxx b/svl/source/notify/SfxBroadcaster.cxx
index 581b07c..f7ae252 100644
--- a/svl/source/notify/SfxBroadcaster.cxx
+++ b/svl/source/notify/SfxBroadcaster.cxx
@@ -25,6 +25,7 @@
 
 #include <svl/SfxBroadcaster.hxx>
 #include <algorithm>
+#include <tools/debug.hxx>
 
 TYPEINIT0(SfxBroadcaster);
 
@@ -85,6 +86,7 @@ SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC )
 
 void SfxBroadcaster::AddListener( SfxListener& rListener )
 {
+    DBG_TESTSOLARMUTEX();
     if (m_RemovedPositions.empty()) {
         m_Listeners.push_back(&rListener);
     }
@@ -122,6 +124,7 @@ void SfxBroadcaster::Forward(SfxBroadcaster& rBC, const SfxHint& rHint)
 
 void SfxBroadcaster::RemoveListener( SfxListener& rListener )
 {
+    DBG_TESTSOLARMUTEX();
     SfxListenerArr_Impl::iterator aIter = std::find(
             m_Listeners.begin(), m_Listeners.end(), &rListener);
     assert(aIter != m_Listeners.end()); // "RemoveListener: Listener unknown"
commit 440b0985cb334f5e76cb0c3f3bcb17135936e035
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 17:12:16 2014 +0200

    SwXAutoTextEntry: de-register on SFX_EVENT_PREPARECLOSEDOC event
    
    Evidently (sw_unoapi) it's possible that ~SwXAutoTextEntry() completes
    but the thing is still registered at a SfxBroadcaster - probably because
    the Notify() method may clear xDocSh without de-registering.
    
    Change-Id: I81a7f4ab3a9f3d685181891d6a7f5a826b7d2bf0

diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 3095807..0eacc65 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -805,6 +805,7 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
             {
                 implFlushDocument( false );
                 xBodyText = 0;
+                EndListening( *&xDocSh );
                 xDocSh.Clear();
             }
         }
commit 0569e10d01a01b9fe3bf18245799dd6f264fd7df
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 16:05:20 2014 +0200

    sd: SdUnoForbiddenCharsTable gets a SolarMutexGuard too
    
    Change-Id: Ie742b7e38e60f6a77f6b7c3e56ac415d8cb836e1

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 85fd970..6cf0bcc 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -143,6 +143,8 @@ void SdUnoForbiddenCharsTable::onChange()
 
 SdUnoForbiddenCharsTable::~SdUnoForbiddenCharsTable()
 {
+    SolarMutexGuard g;
+
     if( mpModel )
         EndListening( *mpModel );
 }
commit 212f25c2270f6d2c32e10c86f4bf3c6cb36e4daa
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 16:05:04 2014 +0200

    scripting: another missing SolarMutex guard
    
    Change-Id: I762dad4d94ab4f27912b4ddac5b6a77f7d685cb8

diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index c6fda32..3f4196e 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -87,6 +87,8 @@ namespace basprov
 
     BasicScriptImpl::~BasicScriptImpl()
     {
+        SolarMutexGuard g;
+
         if ( m_documentBasicManager )
             EndListening( *m_documentBasicManager );
     }
commit 7d754a84926196ff97b548fb5ac4490031885803
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 15:51:07 2014 +0200

    sc: ensure global variables in tests are cleared before shutdown
    
    If the destructors run from exit handlers, they could access already
    deleted globals from VCL etc. and crash.
    
    Change-Id: I265046e95998a4384e1ce0f1f205d03c078a40a9

diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx
index 00933c8..8f24339 100644
--- a/sc/qa/extras/scannotationobj.cxx
+++ b/sc/qa/extras/scannotationobj.cxx
@@ -105,7 +105,10 @@ void ScAnnontationObj::setUp()
 void ScAnnontationObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scannotationshapeobj.cxx b/sc/qa/extras/scannotationshapeobj.cxx
index f306e93..7e3c241 100644
--- a/sc/qa/extras/scannotationshapeobj.cxx
+++ b/sc/qa/extras/scannotationshapeobj.cxx
@@ -63,6 +63,7 @@ void ScAnnotationShapeObj::tearDown()
     {
         mxField.clear();
         closeDocument(mxComponent);
+        mxComponent.clear();
     }
 
     UnoApiTest::tearDown();
diff --git a/sc/qa/extras/scannotationsobj.cxx b/sc/qa/extras/scannotationsobj.cxx
index 9bcd60e..e011ac0 100644
--- a/sc/qa/extras/scannotationsobj.cxx
+++ b/sc/qa/extras/scannotationsobj.cxx
@@ -89,7 +89,10 @@ void ScAnnontationsObj::setUp()
 void ScAnnontationsObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 59d9986..0589676 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -119,7 +119,10 @@ void ScCellRangeObj::setUp()
 void ScCellRangeObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scdatabaserangeobj.cxx b/sc/qa/extras/scdatabaserangeobj.cxx
index 6665ea9..a25b1ff 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -78,7 +78,10 @@ void ScDatabaseRangeObj::setUp()
 void ScDatabaseRangeObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scdatapilotfieldobj.cxx b/sc/qa/extras/scdatapilotfieldobj.cxx
index df28860..cad8aa7 100644
--- a/sc/qa/extras/scdatapilotfieldobj.cxx
+++ b/sc/qa/extras/scdatapilotfieldobj.cxx
@@ -94,7 +94,10 @@ void ScDataPilotFieldObj::setUp()
 void ScDataPilotFieldObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scdatapilottableobj.cxx b/sc/qa/extras/scdatapilottableobj.cxx
index d210691..9f4e0a0 100644
--- a/sc/qa/extras/scdatapilottableobj.cxx
+++ b/sc/qa/extras/scdatapilottableobj.cxx
@@ -148,7 +148,10 @@ void ScDataPilotTableObj::setUp()
 void ScDataPilotTableObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/sceditfieldobj-cell.cxx b/sc/qa/extras/sceditfieldobj-cell.cxx
index 39ea41c..878210b 100644
--- a/sc/qa/extras/sceditfieldobj-cell.cxx
+++ b/sc/qa/extras/sceditfieldobj-cell.cxx
@@ -87,6 +87,7 @@ void ScEditFieldObj_Cell::tearDown()
     {
         mxField.clear();
         closeDocument(mxComponent);
+        mxComponent.clear();
     }
 
     CalcUnoApiTest::tearDown();
diff --git a/sc/qa/extras/sceditfieldobj-header.cxx b/sc/qa/extras/sceditfieldobj-header.cxx
index 47ec24c..c72befd 100644
--- a/sc/qa/extras/sceditfieldobj-header.cxx
+++ b/sc/qa/extras/sceditfieldobj-header.cxx
@@ -85,6 +85,7 @@ void ScEditFieldObj_Header::tearDown()
         mxField.clear();
         mxRightText.clear();
         closeDocument(mxComponent);
+        mxComponent.clear();
     }
 
     CalcUnoApiTest::tearDown();
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
index 65b2ee0..bb04af9 100644
--- a/sc/qa/extras/scmodelobj.cxx
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -64,7 +64,10 @@ void ScModelObj::setUp()
 void ScModelObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     UnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scnamedrangeobj.cxx b/sc/qa/extras/scnamedrangeobj.cxx
index 9ceb7db..da6e331 100644
--- a/sc/qa/extras/scnamedrangeobj.cxx
+++ b/sc/qa/extras/scnamedrangeobj.cxx
@@ -102,7 +102,10 @@ void ScNamedRangeObj::setUp()
 void ScNamedRangeObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scnamedrangesobj.cxx b/sc/qa/extras/scnamedrangesobj.cxx
index 948c3fd..d3eb0f3 100644
--- a/sc/qa/extras/scnamedrangesobj.cxx
+++ b/sc/qa/extras/scnamedrangesobj.cxx
@@ -80,7 +80,10 @@ void ScNamedRangesObj::setUp()
 void ScNamedRangesObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scoutlineobj.cxx b/sc/qa/extras/scoutlineobj.cxx
index 51d7d28..cd27392 100644
--- a/sc/qa/extras/scoutlineobj.cxx
+++ b/sc/qa/extras/scoutlineobj.cxx
@@ -79,7 +79,10 @@ void ScOutlineObj::setUp()
 void ScOutlineObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/scstyleloaderobj.cxx b/sc/qa/extras/scstyleloaderobj.cxx
index 996436f..e79e445 100644
--- a/sc/qa/extras/scstyleloaderobj.cxx
+++ b/sc/qa/extras/scstyleloaderobj.cxx
@@ -109,9 +109,15 @@ void ScStyleLoaderObj::tearDown()
     if (nTest == NUMBER_OF_TESTS)
     {
       if (mxSourceComponent.is())
+      {
           closeDocument(mxSourceComponent);
+          mxSourceComponent.clear();
+      }
       if (mxTargetComponent.is())
+      {
           closeDocument(mxTargetComponent);
+          mxTargetComponent.clear();
+      }
     }
     CalcUnoApiTest::tearDown();
 }
diff --git a/sc/qa/extras/sctablesheetsobj.cxx b/sc/qa/extras/sctablesheetsobj.cxx
index 8db4a5d..0d71349 100644
--- a/sc/qa/extras/sctablesheetsobj.cxx
+++ b/sc/qa/extras/sctablesheetsobj.cxx
@@ -102,7 +102,10 @@ void ScTableSheetsObj::setUp()
 void ScTableSheetsObj::tearDown()
 {
     if (nTest == NUMBER_OF_TESTS)
+    {
         closeDocument(mxComponent);
+        mxComponent.clear();
+    }
 
     CalcUnoApiTest::tearDown();
 }
diff --git a/test/source/sheet/xsheetoutline.cxx b/test/source/sheet/xsheetoutline.cxx
index f8c8e17..a6ff335 100644
--- a/test/source/sheet/xsheetoutline.cxx
+++ b/test/source/sheet/xsheetoutline.cxx
@@ -37,12 +37,12 @@ const OUString rowLevel2 = "OutlineSheet.A3:A27";
 const OUString rowLevel3 = "OutlineSheet.A5:A24";
 const OUString rowLevel4 = "OutlineSheet.A7:A21";
 
-uno::Reference< sheet::XSpreadsheet > aSheetGlobal;
-
-OUString getVisibleAdress(const OUString& aLevelRangeString)
+OUString getVisibleAdress(
+    uno::Reference<sheet::XSpreadsheet> const& xSheet,
+    const OUString& aLevelRangeString)
 {
 
-    uno::Reference<table::XCellRange> aSheetRangeAccess(aSheetGlobal, UNO_QUERY_THROW);
+    uno::Reference<table::XCellRange> aSheetRangeAccess(xSheet, UNO_QUERY_THROW);
     uno::Reference<table::XCellRange> aLevelRange = aSheetRangeAccess->getCellRangeByName(aLevelRangeString);
 
     uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(aLevelRange,UNO_QUERY_THROW);
@@ -53,10 +53,12 @@ OUString getVisibleAdress(const OUString& aLevelRangeString)
 
 }
 
-table::CellRangeAddress getAddressFromRangeString(const OUString& aStringAddress)
+table::CellRangeAddress getAddressFromRangeString(
+    uno::Reference<sheet::XSpreadsheet> const& xSheet,
+    const OUString& aStringAddress)
 {
 
-    uno::Reference< table::XCellRange > aSheetRangeAccess(aSheetGlobal, UNO_QUERY_THROW);
+    uno::Reference< table::XCellRange > aSheetRangeAccess(xSheet, UNO_QUERY_THROW);
     uno::Reference<table::XCellRange> aRange = aSheetRangeAccess->getCellRangeByName(aStringAddress);
 
     uno::Reference<sheet::XCellRangeAddressable> xCellRangeAddressable(aRange, UNO_QUERY_THROW);
@@ -72,19 +74,19 @@ void XSheetOutline::testHideDetail()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-
     // Column level 2
-    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(colLevel2);
+    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, colLevel2);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 not hidden", getVisibleAdress(colLevel2), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 not hidden",
+            getVisibleAdress(aSheet, colLevel2), OUString(""));
 
     // Row Level 2
-    aLevelRangeAddress = getAddressFromRangeString(rowLevel2);
+    aLevelRangeAddress = getAddressFromRangeString(aSheet, rowLevel2);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 not hidden", getVisibleAdress(rowLevel2), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 not hidden",
+            getVisibleAdress(aSheet, rowLevel2), OUString(""));
 
 }
 
@@ -93,21 +95,22 @@ void XSheetOutline::testShowDetail()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-    aSheetOutline->showDetail(getAddressFromRangeString(colLevel1));
-    aSheetOutline->showDetail(getAddressFromRangeString(rowLevel1));
+    aSheetOutline->showDetail(getAddressFromRangeString(aSheet, colLevel1));
+    aSheetOutline->showDetail(getAddressFromRangeString(aSheet, rowLevel1));
 
     // Row Level 2
-    table::CellRangeAddress  aLevelRangeAddress = getAddressFromRangeString(rowLevel2);
+    table::CellRangeAddress  aLevelRangeAddress = getAddressFromRangeString(aSheet, rowLevel2);
     aSheetOutline->showDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 still hidden", getVisibleAdress(rowLevel2), rowLevel2);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 still hidden",
+            getVisibleAdress(aSheet, rowLevel2), rowLevel2);
 
     // Column Level 2
-    aLevelRangeAddress = getAddressFromRangeString(colLevel2);
+    aLevelRangeAddress = getAddressFromRangeString(aSheet, colLevel2);
     aSheetOutline->showDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 still hidden", getVisibleAdress(colLevel2), colLevel2);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 still hidden",
+            getVisibleAdress(aSheet, colLevel2), colLevel2);
 
 }
 
@@ -117,20 +120,18 @@ void XSheetOutline::testShowLevel()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-
     table::CellRangeAddress aLevelRangeAddress;
 
     // test columns
 
-    table::CellRangeAddress aLevel1 = getAddressFromRangeString(colLevel1);
-    table::CellRangeAddress aLevel2 = getAddressFromRangeString(colLevel2);
-    table::CellRangeAddress aLevel3 = getAddressFromRangeString(colLevel3);
-    table::CellRangeAddress aLevel4 = getAddressFromRangeString(colLevel4);
+    table::CellRangeAddress aLevel1 = getAddressFromRangeString(aSheet, colLevel1);
+    table::CellRangeAddress aLevel2 = getAddressFromRangeString(aSheet, colLevel2);
+    table::CellRangeAddress aLevel3 = getAddressFromRangeString(aSheet, colLevel3);
+    table::CellRangeAddress aLevel4 = getAddressFromRangeString(aSheet, colLevel4);
 
-    aSheetOutline->showDetail(getAddressFromRangeString(colLevel1));
-    aSheetOutline->showDetail(getAddressFromRangeString(colLevel2));
-    aSheetOutline->showDetail(getAddressFromRangeString(rowLevel1));
+    aSheetOutline->showDetail(getAddressFromRangeString(aSheet, colLevel1));
+    aSheetOutline->showDetail(getAddressFromRangeString(aSheet, colLevel2));
+    aSheetOutline->showDetail(getAddressFromRangeString(aSheet, rowLevel1));
 
     aSheetOutline->hideDetail(aLevel1);
     aSheetOutline->hideDetail(aLevel2);
@@ -139,14 +140,14 @@ void XSheetOutline::testShowLevel()
 
     aSheetOutline->showLevel(2, table::TableOrientation_COLUMNS);
 
-    std::cout << " verifiy showLevel col apres" << OUStringToOString(getVisibleAdress("OutlineSheet.A1:Z30"), RTL_TEXTENCODING_UTF8).getStr() << std::endl;
+    std::cout << " verifiy showLevel col apres" << OUStringToOString(getVisibleAdress(aSheet, "OutlineSheet.A1:Z30"), RTL_TEXTENCODING_UTF8).getStr() << std::endl;
 
     // verify that level 2 and level 1 are shown --> column 0..3 & column 22..26
     // level 3 & 4 are hidden --> column 4..19
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.A1:D1"), getVisibleAdress("OutlineSheet.A1:D1"));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.V1:Z1"), getVisibleAdress("OutlineSheet.V1:Z1"));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString(""), getVisibleAdress(colLevel3));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.A1:D1"), getVisibleAdress(aSheet, "OutlineSheet.A1:D1"));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.V1:Z1"), getVisibleAdress(aSheet, "OutlineSheet.V1:Z1"));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString(""), getVisibleAdress(aSheet, colLevel3));
 
 /* FIXME !!
 
@@ -191,25 +192,23 @@ void XSheetOutline::testGroup()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-
     // Column level 2
     OUString aNewString = "OutlineSheet.AB1:AG1";
-    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aNewString);
+    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString);
     aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_COLUMNS);
 
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testGroup Column still visible", getVisibleAdress(aNewString), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testGroup Column still visible", getVisibleAdress(aSheet, aNewString), OUString(""));
 
     // Row Level 2
     aNewString = "OutlineSheet.A50:A60";
-    aLevelRangeAddress = getAddressFromRangeString(aNewString);
+    aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString);
     aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_ROWS);
 
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testGroup Row still visible", getVisibleAdress(aNewString), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testGroup Row still visible", getVisibleAdress(aSheet, aNewString), OUString(""));
 
 }
 
@@ -218,11 +217,9 @@ void XSheetOutline::testUngroup()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-
     // New Column level
     OUString aNewString = "OutlineSheet.BB1:BG1";
-    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aNewString);
+    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString);
     aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_COLUMNS);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
@@ -231,11 +228,11 @@ void XSheetOutline::testUngroup()
     aSheetOutline->showDetail(aLevelRangeAddress);
     // should remain hidden ?
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testUnGroup Column becomes visible after ungroup", getVisibleAdress(aNewString), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testUnGroup Column becomes visible after ungroup", getVisibleAdress(aSheet, aNewString), OUString(""));
 
     // New Row level
     aNewString = "OutlineSheet.A70:A80";
-    aLevelRangeAddress = getAddressFromRangeString(aNewString);
+    aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString);
     aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_ROWS);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
@@ -244,7 +241,7 @@ void XSheetOutline::testUngroup()
     aSheetOutline->showDetail(aLevelRangeAddress);
     // should remain hidden ?
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testUnGroup Row becomes visible after ungroup", getVisibleAdress(aNewString), OUString(""));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testUnGroup Row becomes visible after ungroup", getVisibleAdress(aSheet, aNewString), OUString(""));
 
 }
 
@@ -257,17 +254,15 @@ void XSheetOutline::testClearOutline()
     uno::Reference< sheet::XSpreadsheet > aSheet(init(), UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW);
 
-    aSheetGlobal = aSheet;
-
     aSheetOutline->clearOutline();
 
-    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(colLevel1);
+    table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, colLevel1);
     aSheetOutline->hideDetail(aLevelRangeAddress);
-    aLevelRangeAddress = getAddressFromRangeString(rowLevel1);
+    aLevelRangeAddress = getAddressFromRangeString(aSheet, rowLevel1);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after clear", getVisibleAdress(colLevel1), colLevel1);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after clear", getVisibleAdress(rowLevel1), rowLevel1);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after clear", getVisibleAdress(aSheet, colLevel1), colLevel1);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after clear", getVisibleAdress(aSheet, rowLevel1), rowLevel1);
 
 }
 
commit 3da8256185696f5bfa9a4835d398558d5950b73d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 14:44:12 2014 +0200

    SvxShape destructor un-register at broadcaster with SolarMutex locked
    
    Change-Id: Ie9bd6d0fc1b221e77c4d37a26c999aa34afbe0ee

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 30afdb1..5c28342 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -238,6 +238,7 @@ SvxShape::~SvxShape() throw()
 
     delete mpImpl, mpImpl = NULL;
 
+    EndListeningAll(); // call explictily within SolarMutexGuard
 }
 
 
commit 3a218acef4004d8f4dc53bf904127b2a7de3f96a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 14:35:11 2014 +0200

    sc: lock SolarMutex before calling ScDocument::RemoveUnoObject()
    
    This can race against other threads calling AddUnoObject(), and
    hopefully this should fix the assert from SfxBroadcaster::AddListener()
    line 96 that has been observed in sc_unoapi.
    
    Change-Id: Ia2dd38a499c51a77c54cffe9dde31e14053ae0e5

diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index a9dd77d..0c2cb0b 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -42,6 +42,8 @@ ScAddressConversionObj::ScAddressConversionObj(ScDocShell* pDocSh, bool _bIsRang
 
 ScAddressConversionObj::~ScAddressConversionObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 0d19e29..0b7ae88 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1440,6 +1440,8 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) :
 
 ScCellRangesBase::~ScCellRangesBase()
 {
+    SolarMutexGuard g;
+
     //  call RemoveUnoObject first, so no notification can happen
     //  during ForgetCurrentAttrs
 
@@ -8996,6 +8998,8 @@ ScCellsObj::ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR) :
 
 ScCellsObj::~ScCellsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -9093,6 +9097,8 @@ void ScCellsEnumeration::CheckPos_Impl()
 
 ScCellsEnumeration::~ScCellsEnumeration()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
     delete pMark;
@@ -9188,6 +9194,8 @@ ScCellFormatsObj::ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) :
 
 ScCellFormatsObj::~ScCellFormatsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -9317,6 +9325,8 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR
 
 ScCellFormatsEnumeration::~ScCellFormatsEnumeration()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
     delete pIter;
@@ -9416,6 +9426,8 @@ ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange
 
 ScUniqueCellFormatsObj::~ScUniqueCellFormatsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -9672,6 +9684,8 @@ ScUniqueCellFormatsEnumeration::ScUniqueCellFormatsEnumeration(ScDocShell* pDocS
 
 ScUniqueCellFormatsEnumeration::~ScUniqueCellFormatsEnumeration()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 7ba85d1..46d3fae 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1011,6 +1011,8 @@ ScChart2DataProvider::ScChart2DataProvider( ScDocument* pDoc )
 
 ScChart2DataProvider::~ScChart2DataProvider()
 {
+    SolarMutexGuard g;
+
     if ( m_pDocument )
         m_pDocument->RemoveUnoObject( *this);
 }
@@ -2411,6 +2413,8 @@ ScChart2DataSource::ScChart2DataSource( ScDocument* pDoc)
 
 ScChart2DataSource::~ScChart2DataSource()
 {
+    SolarMutexGuard g;
+
     if ( m_pDocument )
         m_pDocument->RemoveUnoObject( *this);
 }
@@ -2515,6 +2519,8 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
 
 ScChart2DataSequence::~ScChart2DataSequence()
 {
+    SolarMutexGuard g;
+
     if ( m_pDocument )
     {
         m_pDocument->RemoveUnoObject( *this);
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index be1db43..c20fcfc 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -96,6 +96,8 @@ ScChartsObj::ScChartsObj(ScDocShell* pDocSh, SCTAB nT) :
 
 ScChartsObj::~ScChartsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -455,6 +457,8 @@ ScChartObj::ScChartObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN)
 
 ScChartObj::~ScChartObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 5891036..636180f 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -89,6 +89,8 @@ ScDocumentConfiguration::ScDocumentConfiguration(ScDocShell* pDocSh)
 
 ScDocumentConfiguration::~ScDocumentConfiguration()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 59c5c5a..57d0559 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -288,6 +288,8 @@ ScDataPilotTablesObj::ScDataPilotTablesObj(ScDocShell* pDocSh, SCTAB nT) :
 
 ScDataPilotTablesObj::~ScDataPilotTablesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -583,6 +585,8 @@ ScDataPilotDescriptorBase::ScDataPilotDescriptorBase(ScDocShell* pDocSh) :
 
 ScDataPilotDescriptorBase::~ScDataPilotDescriptorBase()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index bcf8c77..540771d 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -998,6 +998,8 @@ ScFilterDescriptorBase::ScFilterDescriptorBase(ScDocShell* pDocShell) :
 
 ScFilterDescriptorBase::~ScFilterDescriptorBase()
 {
+    SolarMutexGuard g;
+
     if (pDocSh)
         pDocSh->GetDocument().RemoveUnoObject(*this);
 }
@@ -1653,6 +1655,8 @@ ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab) :
 
 ScDatabaseRangeObj::~ScDatabaseRangeObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -2210,6 +2214,8 @@ ScDatabaseRangesObj::ScDatabaseRangesObj(ScDocShell* pDocSh) :
 
 ScDatabaseRangesObj::~ScDatabaseRangesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -2405,6 +2411,8 @@ ScUnnamedDatabaseRangesObj::ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh) :
 
 ScUnnamedDatabaseRangesObj::~ScUnnamedDatabaseRangesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index 8c098af..0fb8f8f 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -82,6 +82,8 @@ ScDocDefaultsObj::ScDocDefaultsObj(ScDocShell* pDocSh) :
 
 ScDocDefaultsObj::~ScDocDefaultsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c4c5b0a..de14652 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -362,6 +362,8 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
 
 ScModelObj::~ScModelObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 
@@ -2425,6 +2427,8 @@ ScDrawPagesObj::ScDrawPagesObj(ScDocShell* pDocSh) :
 
 ScDrawPagesObj::~ScDrawPagesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -2535,6 +2539,8 @@ ScTableSheetsObj::ScTableSheetsObj(ScDocShell* pDocSh) :
 
 ScTableSheetsObj::~ScTableSheetsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -2943,6 +2949,8 @@ ScTableColumnsObj::ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT, SCCOL nSC, SC
 
 ScTableColumnsObj::~ScTableColumnsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -3209,6 +3217,8 @@ ScTableRowsObj::ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT, SCROW nSR, SCROW nE
 
 ScTableRowsObj::~ScTableRowsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -3484,6 +3494,8 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableRowsObj )
 
 ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -3536,6 +3548,8 @@ ScAnnotationsObj::ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT) :
 
 ScAnnotationsObj::~ScAnnotationsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -3666,6 +3680,8 @@ ScScenariosObj::ScScenariosObj(ScDocShell* pDocSh, SCTAB nT) :
 
 ScScenariosObj::~ScScenariosObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index d27a293..8aa5ca9 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -35,6 +35,8 @@ ScDrawDefaultsObj::ScDrawDefaultsObj(ScDocShell* pDocSh) :
 
 ScDrawDefaultsObj::~ScDrawDefaultsObj() throw ()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index 79e2971..80aabff 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -37,6 +37,8 @@ ScSheetEventsObj::ScSheetEventsObj(ScDocShell* pDocSh, SCTAB nT) :
 
 ScSheetEventsObj::~ScSheetEventsObj()
 {
+    SolarMutexGuard g;
+
     if (mpDocShell)
         mpDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 4e3a4b7..36da296 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -289,6 +289,8 @@ ScCellFieldsObj::ScCellFieldsObj(
 
 ScCellFieldsObj::~ScCellFieldsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index 6f1562f..c6fe2d4 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -53,6 +53,8 @@ ScForbiddenCharsObj::ScForbiddenCharsObj( ScDocShell* pDocSh ) :
 
 ScForbiddenCharsObj::~ScForbiddenCharsObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 2f895d8..1bc5987 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -82,6 +82,8 @@ ScSheetLinkObj::ScSheetLinkObj(ScDocShell* pDocSh, const OUString& rName) :
 
 ScSheetLinkObj::~ScSheetLinkObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -380,6 +382,8 @@ ScSheetLinksObj::ScSheetLinksObj(ScDocShell* pDocSh) :
 
 ScSheetLinksObj::~ScSheetLinksObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -607,6 +611,8 @@ ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, size_t nP) :
 
 ScAreaLinkObj::~ScAreaLinkObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -923,6 +929,8 @@ ScAreaLinksObj::ScAreaLinksObj(ScDocShell* pDocSh) :
 
 ScAreaLinksObj::~ScAreaLinksObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -1049,6 +1057,8 @@ ScDDELinkObj::ScDDELinkObj(ScDocShell* pDocSh, const OUString& rA,
 
 ScDDELinkObj::~ScDDELinkObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -1246,6 +1256,8 @@ ScDDELinksObj::ScDDELinksObj(ScDocShell* pDocSh) :
 
 ScDDELinksObj::~ScDDELinksObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 4989cd0..8fe14eb 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -92,6 +92,8 @@ ScNamedRangeObj::ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, Sc
 
 ScNamedRangeObj::~ScNamedRangeObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -473,6 +475,8 @@ ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
 
 ScNamedRangesObj::~ScNamedRangesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -935,6 +939,8 @@ ScLabelRangeObj::ScLabelRangeObj(ScDocShell* pDocSh, bool bCol, const ScRange& r
 
 ScLabelRangeObj::~ScLabelRangeObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -1054,6 +1060,8 @@ ScLabelRangesObj::ScLabelRangesObj(ScDocShell* pDocSh, bool bCol) :
 
 ScLabelRangesObj::~ScLabelRangesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index fed3a83..c3b8701 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -68,6 +68,8 @@ ScAnnotationObj::ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos) :
 
 ScAnnotationObj::~ScAnnotationObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index b32e23f..d06f68b 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -403,6 +403,8 @@ ScStyleFamiliesObj::ScStyleFamiliesObj(ScDocShell* pDocSh) :
 
 ScStyleFamiliesObj::~ScStyleFamiliesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -618,6 +620,8 @@ ScStyleFamilyObj::ScStyleFamilyObj(ScDocShell* pDocSh, SfxStyleFamily eFam) :
 
 ScStyleFamilyObj::~ScStyleFamilyObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -974,6 +978,8 @@ void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
 
 ScStyleObj::~ScStyleObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 9ec5b0e..75777fb 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -75,6 +75,8 @@ ScLinkTargetTypesObj::ScLinkTargetTypesObj(ScDocShell* pDocSh) :
 
 ScLinkTargetTypesObj::~ScLinkTargetTypesObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
@@ -142,6 +144,8 @@ ScLinkTargetTypeObj::ScLinkTargetTypeObj(ScDocShell* pDocSh, sal_uInt16 nT) :
 
 ScLinkTargetTypeObj::~ScLinkTargetTypeObj()
 {
+    SolarMutexGuard g;
+
     if (pDocShell)
         pDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 47738aa..5e5d595 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -72,6 +72,8 @@ ScFormulaParserObj::ScFormulaParserObj(ScDocShell* pDocSh) :
 
 ScFormulaParserObj::~ScFormulaParserObj()
 {
+    SolarMutexGuard g;
+
     if (mpDocShell)
         mpDocShell->GetDocument().RemoveUnoObject(*this);
 }
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 05ba436..e427e1f 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -231,6 +231,8 @@ void ScTabViewShell::AddAccessibilityObject( SfxListener& rObject )
 
 void ScTabViewShell::RemoveAccessibilityObject( SfxListener& rObject )
 {
+    SolarMutexGuard g;
+
     if (pAccessibilityBroadcaster)
     {
         rObject.EndListening( *pAccessibilityBroadcaster );
commit bc8a11cf663c41fbe3245640a6159bd0ea6d9ce7
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 14:21:41 2014 +0200

    chart2: add a SolarMutexGuard in ChartView::createInstance()
    
    SvxUnoNameItemTable::SvxUnoNameItemTable() registers a listener at
    SdrModel, surely that needs a lock of some kind.
    
    Change-Id: I80d5a31be66e75f07e8abd26504bdcc93ffd22a3

diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 6266b87..deeda97 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -321,8 +321,8 @@ ChartView::~ChartView()
 
     if( m_pDrawModelWrapper.get() )
     {
-        EndListening( m_pDrawModelWrapper->getSdrModel(), false /*bAllDups*/ );
         SolarMutexGuard aSolarGuard;
+        EndListening( m_pDrawModelWrapper->getSdrModel(), false /*bAllDups*/ );
         m_pDrawModelWrapper.reset();
     }
     m_xDrawPage = NULL;
@@ -2882,6 +2882,8 @@ void SAL_CALL ChartView::removeVetoableChangeListener( const OUString& /* Proper
 Reference< uno::XInterface > ChartView::createInstance( const OUString& aServiceSpecifier )
     throw (uno::Exception, uno::RuntimeException, std::exception)
 {
+    SolarMutexGuard aSolarGuard;
+
     SdrModel* pModel = ( m_pDrawModelWrapper ? &m_pDrawModelWrapper->getSdrModel() : NULL );
     if ( pModel )
     {


More information about the Libreoffice-commits mailing list