diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-02 02:02:21 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-02 02:02:27 +0100 |
commit | c1258abe50f1508ea0f628ff963bc1914ab86b67 (patch) | |
tree | 149167002f6865a4f6543d38999cc0e1a13b6291 /svx/source/accessibility | |
parent | 3ae3af4a989758a0772881b1a2a6c1a68ee67dda (diff) |
tdf#96365: ensure holding SolarMutex before triggering core code
(likely a bad sign that this compilation unit, defines lots of UNO
interfaces without ever using a SolarMutexGuard)
Change-Id: I2cca810f8e4e1684c75d9185d701024f692403a4
Diffstat (limited to 'svx/source/accessibility')
-rw-r--r-- | svx/source/accessibility/AccessibleControlShape.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 03e6a2c1de31..ab768d742fc9 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -42,6 +42,7 @@ #include <svx/svdview.hxx> #include <svx/svdpagv.hxx> #include "svx/svdstr.hrc" +#include <vcl/svapp.hxx> #include <algorithm> using namespace ::accessibility; @@ -466,24 +467,24 @@ void SAL_CALL AccessibleControlShape::notifyEvent( const AccessibleEventObject& } } -void SAL_CALL AccessibleControlShape::modeChanged( const ModeChangeEvent& _rSource ) throw (RuntimeException, std::exception) +void SAL_CALL AccessibleControlShape::modeChanged(const ModeChangeEvent& rSource) throw (RuntimeException, std::exception) { // did it come from our inner context (the real one, not it's proxy!)? - OSL_TRACE ("AccessibleControlShape::modeChanged"); - Reference< XControl > xSource( _rSource.Source, UNO_QUERY ); // for faster compare - if ( xSource.get() == m_xUnoControl.get() ) - { - // If our "pseudo-aggregated" inner context does not live anymore, - // we don't want to live, too. This is accomplished by asking our - // parent to replace this object with a new one. Disposing this - // object and sending notifications about the replacement are in - // the responsibility of our parent. - OSL_VERIFY( mpParent->ReplaceChild ( this, mxShape, mnIndex, maShapeTreeInfo ) ); + SAL_INFO("sw.uno", "AccessibleControlShape::modeChanged"); + Reference<XControl> xSource(rSource.Source, UNO_QUERY); // for faster compare + if(xSource.get() != m_xUnoControl.get()) + { + SAL_WARN("sw.uno", "AccessibleControlShape::modeChanged: where did this come from?"); + return; } -#if OSL_DEBUG_LEVEL > 0 - else - OSL_FAIL( "AccessibleControlShape::modeChanged: where did this come from?" ); -#endif + SolarMutexGuard g; + // If our "pseudo-aggregated" inner context does not live anymore, + // we don't want to live, too. This is accomplished by asking our + // parent to replace this object with a new one. Disposing this + // object and sending notifications about the replacement are in + // the responsibility of our parent. + const bool bReplaced = mpParent->ReplaceChild(this, mxShape, mnIndex, maShapeTreeInfo); + SAL_WARN_IF(!bReplaced, "sw.uno", "AccessibleControlShape::modeChanged: replacing ourselves away did fail"); } void SAL_CALL AccessibleControlShape::disposing (const EventObject& _rSource) throw (RuntimeException, std::exception) |