summaryrefslogtreecommitdiff
path: root/framework/source/uifactory
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-20 10:08:30 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-20 10:49:39 +0100
commitda9aaab596ef4cd24f43902a047332971c92ffb2 (patch)
treea05b22d58eb3e3fbabaa710728fff9f5e5e163b6 /framework/source/uifactory
parent306859babd5a997a1e5d50e7791e8e5852a7ea2e (diff)
Use an osl::Mutex directly
Change-Id: Ia0a0dfae4390ad8cd74520396ecfbd6ac03a5d6f
Diffstat (limited to 'framework/source/uifactory')
-rw-r--r--framework/source/uifactory/factoryconfiguration.cxx33
1 files changed, 11 insertions, 22 deletions
diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx
index 5320caaf52da..0b2c2b1be14d 100644
--- a/framework/source/uifactory/factoryconfiguration.cxx
+++ b/framework/source/uifactory/factoryconfiguration.cxx
@@ -18,7 +18,6 @@
*/
#include "uifactory/factoryconfiguration.hxx"
-#include <threadhelp/guard.hxx>
#include "services.h"
#include "helper/mischelper.hxx"
@@ -60,7 +59,6 @@ OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aMo
// XInterface, XTypeProvider
ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( const Reference< XComponentContext >& rxContext, const OUString& _sRoot,bool _bAskValue ) :
- ThreadHelpBase(),
m_aPropCommand( "Command" ),
m_aPropModule( "Module" ),
m_aPropController( "Controller" ),
@@ -74,8 +72,7 @@ ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( co
ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
if ( xContainer.is() )
@@ -84,8 +81,7 @@ ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
if ( pIter != m_aMenuControllerMap.end() )
@@ -103,8 +99,7 @@ OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( con
}
OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
@@ -128,8 +123,7 @@ void ConfigurationAccess_ControllerFactory::addServiceToCommandModule(
const OUString& rModule,
const OUString& rServiceSpecifier )
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
m_aMenuControllerMap.insert( MenuControllerMap::value_type( aHashKey,ControllerInfo(rServiceSpecifier,OUString()) ));
@@ -139,8 +133,7 @@ void ConfigurationAccess_ControllerFactory::removeServiceFromCommandModule(
const OUString& rCommandURL,
const OUString& rModule )
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
m_aMenuControllerMap.erase( aHashKey );
@@ -154,8 +147,7 @@ void SAL_CALL ConfigurationAccess_ControllerFactory::elementInserted( const Cont
OUString aService;
OUString aValue;
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
{
@@ -175,8 +167,7 @@ void SAL_CALL ConfigurationAccess_ControllerFactory::elementRemoved ( const Cont
OUString aService;
OUString aValue;
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
{
@@ -195,16 +186,15 @@ void SAL_CALL ConfigurationAccess_ControllerFactory::elementReplaced( const Cont
// lang.XEventListener
void SAL_CALL ConfigurationAccess_ControllerFactory::disposing( const EventObject& ) throw(RuntimeException, std::exception)
{
- // SAFE
// remove our reference to the config access
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
m_xConfigAccess.clear();
}
void ConfigurationAccess_ControllerFactory::readConfigurationData()
{
// SAFE
- Guard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_mutex );
if ( !m_bConfigAccessInitialized )
{
@@ -233,7 +223,7 @@ void ConfigurationAccess_ControllerFactory::readConfigurationData()
uno::Reference< container::XContainer > xContainer( m_xConfigAccess, uno::UNO_QUERY );
// UNSAFE
- aLock.unlock();
+ aLock.clear();
if ( xContainer.is() )
{
@@ -245,8 +235,7 @@ void ConfigurationAccess_ControllerFactory::readConfigurationData()
void ConfigurationAccess_ControllerFactory::updateConfigurationData()
{
- // SAFE
- Guard aLock( m_aLock );
+ osl::MutexGuard g(m_mutex);
if ( m_xConfigAccess.is() )
{
Sequence< OUString > aPopupMenuControllers = m_xConfigAccess->getElementNames();