diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 15:07:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 15:27:08 +0100 |
commit | f7d4bcfd4532a9b86d535f7b2a63532a240e758d (patch) | |
tree | 5c2ebc1c64cf4d8066d770de6e767d8edbf279c9 /framework | |
parent | e6e3403f1fce1ad9285a4b41fea8b46cad6cf191 (diff) |
Use SolarMutexGuard directly
Change-Id: Iffc5e75c45502c770e9a3eee2a327df1e6843c9f
Diffstat (limited to 'framework')
5 files changed, 19 insertions, 22 deletions
diff --git a/framework/inc/helper/uielementwrapperbase.hxx b/framework/inc/helper/uielementwrapperbase.hxx index 649a21f4dc03..3fe180536911 100644 --- a/framework/inc/helper/uielementwrapperbase.hxx +++ b/framework/inc/helper/uielementwrapperbase.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_FRAMEWORK_INC_HELPER_UIELEMENTWRAPPERBASE_HXX #define INCLUDED_FRAMEWORK_INC_HELPER_UIELEMENTWRAPPERBASE_HXX -#include <threadhelp/threadhelpbase.hxx> #include <macros/generic.hxx> #include <macros/xinterface.hxx> #include <macros/xtypeprovider.hxx> @@ -32,6 +31,7 @@ #include <com/sun/star/util/XUpdatable.hpp> #include <rtl/ustring.hxx> +#include <cppuhelper/basemutex.hxx> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/implbase4.hxx> @@ -44,7 +44,7 @@ typedef ::cppu::WeakImplHelper4< ::com::sun::star::lang::XComponent, ::com::sun::star::util::XUpdatable > UIElementWrapperBase_BASE; -class UIElementWrapperBase : protected ThreadHelpBase , +class UIElementWrapperBase : private cppu::BaseMutex, public ::cppu::OBroadcastHelper , public ::cppu::OPropertySetHelper , public UIElementWrapperBase_BASE diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx index c59a1d8f42e9..c376635f41c8 100644 --- a/framework/source/helper/uielementwrapperbase.cxx +++ b/framework/source/helper/uielementwrapperbase.cxx @@ -20,7 +20,6 @@ #include <helper/uielementwrapperbase.hxx> #include <general.h> #include <properties.h> -#include <threadhelp/guard.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -45,10 +44,9 @@ namespace framework { UIElementWrapperBase::UIElementWrapperBase( sal_Int16 nType ) - : ThreadHelpBase ( &Application::GetSolarMutex() ) - , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() ) + : ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex ) , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) - , m_aListenerContainer ( m_aLock.getShareableOslMutex() ) + , m_aListenerContainer ( m_aMutex ) , m_nType ( nType ) , m_bInitialized ( sal_False ) , m_bDisposed ( sal_False ) @@ -88,7 +86,7 @@ void SAL_CALL UIElementWrapperBase::removeEventListener( const ::com::sun::star: void SAL_CALL UIElementWrapperBase::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception ) { - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( !m_bInitialized ) { diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index 75418fab3a0f..03698c1bba45 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -71,7 +71,7 @@ void SAL_CALL AddonsToolBarWrapper::dispose() throw ( RuntimeException, std::exc com::sun::star::lang::EventObject aEvent( xThis ); m_aListenerContainer.disposeAndClear( aEvent ); - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_xToolBarManager.is() ) m_xToolBarManager->dispose(); @@ -83,7 +83,7 @@ void SAL_CALL AddonsToolBarWrapper::dispose() throw ( RuntimeException, std::exc // XInitialization void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception ) { - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) throw DisposedException(); @@ -145,7 +145,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument // XUIElement interface Reference< XInterface > SAL_CALL AddonsToolBarWrapper::getRealInterface() throw (::com::sun::star::uno::RuntimeException, std::exception) { - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_xToolBarManager.is() ) { @@ -163,7 +163,7 @@ Reference< XInterface > SAL_CALL AddonsToolBarWrapper::getRealInterface() throw // allow late population of images for add-on toolbars void AddonsToolBarWrapper::populateImages() { - Guard aLock( m_aLock ); + SolarMutexGuard g; if (m_bCreatedImages) return; diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx index 5cca6dd6291d..b7e22a8c804a 100644 --- a/framework/source/uielement/progressbarwrapper.cxx +++ b/framework/source/uielement/progressbarwrapper.cxx @@ -49,7 +49,7 @@ ProgressBarWrapper::~ProgressBarWrapper() // public interfaces void ProgressBarWrapper::setStatusBar( const uno::Reference< awt::XWindow >& rStatusBar, sal_Bool bOwnsInstance ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -75,7 +75,7 @@ void ProgressBarWrapper::setStatusBar( const uno::Reference< awt::XWindow >& rSt uno::Reference< awt::XWindow > ProgressBarWrapper::getStatusBar() const { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return uno::Reference< awt::XWindow >(); @@ -91,7 +91,7 @@ throw (uno::RuntimeException) sal_Int32 nValue( 0 ); { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -130,7 +130,7 @@ throw (uno::RuntimeException) uno::Reference< awt::XWindow > xWindow; { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -160,7 +160,7 @@ throw (uno::RuntimeException) sal_Int32 nValue( 0 ); { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -199,7 +199,7 @@ throw (uno::RuntimeException) sal_Bool bSetValue( sal_False ); { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -267,7 +267,7 @@ throw (uno::RuntimeException, std::exception) uno::UNO_QUERY ); { - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return; @@ -277,7 +277,7 @@ throw (uno::RuntimeException, std::exception) lang::EventObject aEvent( xThis ); m_aListenerContainer.disposeAndClear( aEvent ); - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_bOwnsInstance ) { try @@ -300,9 +300,7 @@ throw (uno::RuntimeException, std::exception) uno::Reference< uno::XInterface > SAL_CALL ProgressBarWrapper::getRealInterface() throw (uno::RuntimeException, std::exception) { - /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - // Ready for multithreading - Guard aLock( m_aLock ); + SolarMutexGuard g; if ( m_bDisposed ) return uno::Reference< uno::XInterface >(); diff --git a/framework/source/uifactory/addonstoolbarfactory.cxx b/framework/source/uifactory/addonstoolbarfactory.cxx index a5079773b804..6a2668e8ad73 100644 --- a/framework/source/uifactory/addonstoolbarfactory.cxx +++ b/framework/source/uifactory/addonstoolbarfactory.cxx @@ -19,6 +19,7 @@ #include <uielement/addonstoolbarwrapper.hxx> #include <threadhelp/guard.hxx> +#include <threadhelp/threadhelpbase.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/ModuleManager.hpp> |