diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-11-01 00:22:41 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-11-01 12:24:32 -0500 |
commit | d0dbce798b47bb9e728f59f5f93fff8215876ab5 (patch) | |
tree | 330400341bba219061c17e9be210408729ef9c87 /svtools/source/toolpanel | |
parent | e5eab37d6fa6d49790d44e15b5908f0a735a629a (diff) |
remove a confusing use of GetMutex() when a SolarMutexGuard is really meant
VCLXDevice, VCLXGraphics and derived class use a mutex that is really
a reference to the SolarMutex. They declare a function GetMutex() to
access tis reference to the SolarMutex, and the implementation
use
osl::SolarGuard aGuard(GetMutex())
to take a guad on the solar mutex.
This is confusing because some other class in that framework also implement
a GetMutex() function, but which this time return a regular Mutex.
Since this particular use of GetMutex() is to get the SolarMutex, and
invariably this is then used to take a Guard on the SolarMutex,
all these uses are replaced by a SolarMutexGuard object, which encapsulate
that behavior.
Diffstat (limited to 'svtools/source/toolpanel')
-rw-r--r-- | svtools/source/toolpanel/paneltabbarpeer.cxx | 5 | ||||
-rw-r--r-- | svtools/source/toolpanel/toolpaneldeckpeer.cxx | 5 | ||||
-rw-r--r-- | svtools/source/toolpanel/toolpaneldrawerpeer.cxx | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/svtools/source/toolpanel/paneltabbarpeer.cxx b/svtools/source/toolpanel/paneltabbarpeer.cxx index ce22d1b7c914..82b94ad7b4d3 100644 --- a/svtools/source/toolpanel/paneltabbarpeer.cxx +++ b/svtools/source/toolpanel/paneltabbarpeer.cxx @@ -35,6 +35,7 @@ /** === end UNO includes === **/ #include <tools/diagnose_ex.h> +#include <vcl/svapp.hxx> //........................................................................ namespace svt @@ -75,7 +76,7 @@ namespace svt //------------------------------------------------------------------------------------------------------------------ Reference< XAccessibleContext > PanelTabBarPeer::CreateAccessibleContext() { - ::osl::SolarGuard aSolarGuard( GetMutex() ); + SolarMutexGuard aSolarGuard; if ( m_pTabBar == NULL ) throw DisposedException( ::rtl::OUString(), *this ); @@ -91,7 +92,7 @@ namespace svt void SAL_CALL PanelTabBarPeer::dispose() throw(RuntimeException) { { - ::osl::SolarGuard aSolarGuard( GetMutex() ); + SolarMutexGuard aSolarGuard; m_pTabBar = NULL; } VCLXWindow::dispose(); diff --git a/svtools/source/toolpanel/toolpaneldeckpeer.cxx b/svtools/source/toolpanel/toolpaneldeckpeer.cxx index c0a6f041f06f..8565b30f0e0a 100644 --- a/svtools/source/toolpanel/toolpaneldeckpeer.cxx +++ b/svtools/source/toolpanel/toolpaneldeckpeer.cxx @@ -35,6 +35,7 @@ /** === end UNO includes === **/ #include <tools/diagnose_ex.h> +#include <vcl/svapp.hxx> //...................................................................................................................... namespace svt @@ -75,7 +76,7 @@ namespace svt //------------------------------------------------------------------------------------------------------------------ Reference< XAccessibleContext > ToolPanelDeckPeer::CreateAccessibleContext() { - ::osl::SolarGuard aSolarGuard( GetMutex() ); + SolarMutexGuard aSolarGuard; if ( m_pDeck == NULL ) throw DisposedException( ::rtl::OUString(), *this ); @@ -89,7 +90,7 @@ namespace svt void SAL_CALL ToolPanelDeckPeer::dispose() throw(RuntimeException) { { - ::osl::SolarGuard aSolarGuard( GetMutex() ); + SolarMutexGuard aSolarGuard; m_pDeck = NULL; } VCLXWindow::dispose(); diff --git a/svtools/source/toolpanel/toolpaneldrawerpeer.cxx b/svtools/source/toolpanel/toolpaneldrawerpeer.cxx index e6282c530a00..1d264dc3228d 100644 --- a/svtools/source/toolpanel/toolpaneldrawerpeer.cxx +++ b/svtools/source/toolpanel/toolpaneldrawerpeer.cxx @@ -39,6 +39,7 @@ #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <vcl/vclevent.hxx> +#include <vcl/svapp.hxx> //...................................................................................................................... namespace svt @@ -134,7 +135,7 @@ namespace svt //------------------------------------------------------------------------------------------------------------------ Reference< XAccessibleContext > ToolPanelDrawerPeer::CreateAccessibleContext() { - ::osl::SolarGuard aSolarGuard( GetMutex() ); + SolarMutexGuard aSolarGuard; return new ToolPanelDrawerContext( *this ); } |