Kaydet (Commit) 7f0a6e26 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use an osl::Mutex directly

Change-Id: I7131abdc2202f80f0e9600d04633bbd6078700bf
üst da9aaab5
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <list> #include <list>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx> #include <macros/generic.hxx>
#include <macros/xinterface.hxx> #include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx> #include <macros/xtypeprovider.hxx>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include "uiconfiguration/globalsettings.hxx" #include "uiconfiguration/globalsettings.hxx"
#include <threadhelp/guard.hxx>
#include "services.h" #include "services.h"
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
...@@ -59,8 +58,7 @@ namespace framework ...@@ -59,8 +58,7 @@ namespace framework
// Configuration access class for WindowState supplier implementation // Configuration access class for WindowState supplier implementation
class GlobalSettings_Access : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses. class GlobalSettings_Access : public ::cppu::WeakImplHelper2<
public ::cppu::WeakImplHelper2<
::com::sun::star::lang::XComponent, ::com::sun::star::lang::XComponent,
::com::sun::star::lang::XEventListener> ::com::sun::star::lang::XEventListener>
{ {
...@@ -83,6 +81,7 @@ class GlobalSettings_Access : private ThreadHelpBase , ...@@ -83,6 +81,7 @@ class GlobalSettings_Access : private ThreadHelpBase ,
private: private:
sal_Bool impl_initConfigAccess(); sal_Bool impl_initConfigAccess();
osl::Mutex m_mutex;
sal_Bool m_bDisposed : 1, sal_Bool m_bDisposed : 1,
m_bConfigRead : 1; m_bConfigRead : 1;
OUString m_aConfigSettingsAccess; OUString m_aConfigSettingsAccess;
...@@ -98,7 +97,6 @@ class GlobalSettings_Access : private ThreadHelpBase , ...@@ -98,7 +97,6 @@ class GlobalSettings_Access : private ThreadHelpBase ,
GlobalSettings_Access::GlobalSettings_Access( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : GlobalSettings_Access::GlobalSettings_Access( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) :
ThreadHelpBase(),
m_bDisposed( sal_False ), m_bDisposed( sal_False ),
m_bConfigRead( sal_False ), m_bConfigRead( sal_False ),
m_aConfigSettingsAccess( GLOBALSETTINGS_ROOT_ACCESS ), m_aConfigSettingsAccess( GLOBALSETTINGS_ROOT_ACCESS ),
...@@ -118,9 +116,7 @@ GlobalSettings_Access::~GlobalSettings_Access() ...@@ -118,9 +116,7 @@ GlobalSettings_Access::~GlobalSettings_Access()
void SAL_CALL GlobalSettings_Access::dispose() void SAL_CALL GlobalSettings_Access::dispose()
throw ( css::uno::RuntimeException, std::exception ) throw ( css::uno::RuntimeException, std::exception )
{ {
// SAFE osl::MutexGuard g(m_mutex);
Guard aLock( m_aLock );
m_xConfigAccess.clear(); m_xConfigAccess.clear();
m_bDisposed = sal_True; m_bDisposed = sal_True;
} }
...@@ -139,15 +135,14 @@ throw (css::uno::RuntimeException, std::exception) ...@@ -139,15 +135,14 @@ throw (css::uno::RuntimeException, std::exception)
void SAL_CALL GlobalSettings_Access::disposing( const css::lang::EventObject& ) void SAL_CALL GlobalSettings_Access::disposing( const css::lang::EventObject& )
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
// SAFE osl::MutexGuard g(m_mutex);
Guard aLock( m_aLock );
m_xConfigAccess.clear(); m_xConfigAccess.clear();
} }
// settings access // settings access
sal_Bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eElementType ) sal_Bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eElementType )
{ {
Guard aLock( m_aLock ); osl::MutexGuard g(m_mutex);
if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW ) if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW )
return sal_False; return sal_False;
else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR ) else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR )
...@@ -185,7 +180,7 @@ sal_Bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eEl ...@@ -185,7 +180,7 @@ sal_Bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eEl
sal_Bool GlobalSettings_Access::GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, ::com::sun::star::uno::Any& aValue ) sal_Bool GlobalSettings_Access::GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, ::com::sun::star::uno::Any& aValue )
{ {
Guard aLock( m_aLock ); osl::MutexGuard g(m_mutex);
if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW ) if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW )
return sal_False; return sal_False;
else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR ) else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment