[Libreoffice-commits] core.git: 11 commits - framework/inc framework/source sw/source

Stephan Bergmann sbergman at redhat.com
Wed Mar 19 10:27:23 PDT 2014


 framework/inc/uiconfiguration/moduleimagemanager.hxx              |    4 
 framework/inc/uielement/menubarmanager.hxx                        |    3 
 framework/inc/uielement/statusbarmanager.hxx                      |    5 
 framework/inc/uielement/toolbarmanager.hxx                        |    5 
 framework/inc/xml/acceleratorconfigurationreader.hxx              |    4 
 framework/inc/xml/acceleratorconfigurationwriter.hxx              |    3 
 framework/inc/xml/imagesdocumenthandler.hxx                       |    6 
 framework/source/uiconfiguration/moduleimagemanager.cxx           |    3 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   69 ++++------
 framework/source/uiconfiguration/uiconfigurationmanager.cxx       |   57 +++-----
 framework/source/uielement/addonstoolbarmanager.cxx               |    6 
 framework/source/uielement/menubarmanager.cxx                     |   56 +++-----
 framework/source/uielement/statusbarmanager.cxx                   |   44 ++----
 framework/source/uielement/toolbarmanager.cxx                     |   50 +++----
 framework/source/uifactory/addonstoolbarfactory.cxx               |   11 -
 framework/source/xml/acceleratorconfigurationreader.cxx           |    3 
 framework/source/xml/acceleratorconfigurationwriter.cxx           |   29 +---
 framework/source/xml/imagesdocumenthandler.cxx                    |   18 --
 sw/source/core/uibase/shells/textsh1.cxx                          |    2 
 sw/source/core/uibase/shells/txtnum.cxx                           |    4 
 20 files changed, 163 insertions(+), 219 deletions(-)

New commits:
commit 5b3c93141253e224a8beaae415c88b6378c9919e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 18:24:10 2014 +0100

    loplugin:literaltoboolconversion
    
    Change-Id: Ifc003e3e986fbe79f8aff5a9edb05a7f22e0f24b

diff --git a/sw/source/core/uibase/shells/textsh1.cxx b/sw/source/core/uibase/shells/textsh1.cxx
index 581c239..05fccf2 100644
--- a/sw/source/core/uibase/shells/textsh1.cxx
+++ b/sw/source/core/uibase/shells/textsh1.cxx
@@ -1519,7 +1519,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
                 sal_uInt16 nHtmlMode = ::GetHtmlMode( GetView().GetDocShell() );
                 nHtmlMode &= HTMLMODE_ON | HTMLMODE_SOME_STYLES;
                 if ( ( nHtmlMode == HTMLMODE_ON )
-                     || !rSh.IsMoveLeftMargin( SID_INC_INDENT == nWhich, sal_True ) )
+                     || !rSh.IsMoveLeftMargin( SID_INC_INDENT == nWhich, true ) )
                 {
                     rSet.DisableItem( nWhich );
                 }
diff --git a/sw/source/core/uibase/shells/txtnum.cxx b/sw/source/core/uibase/shells/txtnum.cxx
index f555227..1d211b6 100644
--- a/sw/source/core/uibase/shells/txtnum.cxx
+++ b/sw/source/core/uibase/shells/txtnum.cxx
@@ -210,7 +210,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
             // If the Dialog was leaved with OK but nothing was chosen then the
             // numbering must be at least activated, if it is not already.
             else if ( pNumRuleAtCurrentSelection == NULL
-                      && SFX_ITEM_SET == aSet.GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem ) )
+                      && SFX_ITEM_SET == aSet.GetItemState( SID_ATTR_NUMBERING_RULE, false, &pItem ) )
             {
                 rReq.AppendItem( *pItem );
                 rReq.Done();
@@ -246,7 +246,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
     case FN_SVX_SET_NUMBER:
     case FN_SVX_SET_BULLET:
         {
-            SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, nSlot, sal_False );
+            SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, nSlot, false );
             if ( pItem != NULL )
             {
                 const sal_uInt16 nChoosenItemIdx = pItem->GetValue();
commit 2299b5964db383f2d742227df283db58939f8128
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 18:12:57 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: Ibddf0ab4107772a65f27851b1ebce3f7bb5d3bcf

diff --git a/framework/inc/uiconfiguration/moduleimagemanager.hxx b/framework/inc/uiconfiguration/moduleimagemanager.hxx
index 0328c03..d344b3a 100644
--- a/framework/inc/uiconfiguration/moduleimagemanager.hxx
+++ b/framework/inc/uiconfiguration/moduleimagemanager.hxx
@@ -29,7 +29,6 @@
 #include <boost/unordered_map.hpp>
 #include <memory>
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -59,8 +58,7 @@ namespace framework
 {
     class ImageManagerImpl;
 
-    class ModuleImageManager :    private ThreadHelpBase                                          , // Struct for right initalization of mutex member! Must be first of baseclasses.
-                                  public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XImageManager>
+    class ModuleImageManager :    public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XImageManager>
     {
         public:
             ModuleImageManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
diff --git a/framework/source/uiconfiguration/moduleimagemanager.cxx b/framework/source/uiconfiguration/moduleimagemanager.cxx
index 1387d06..be76ffe 100644
--- a/framework/source/uiconfiguration/moduleimagemanager.cxx
+++ b/framework/source/uiconfiguration/moduleimagemanager.cxx
@@ -70,8 +70,7 @@ using namespace ::com::sun::star::ui;
 namespace framework
 {
 ModuleImageManager::ModuleImageManager( const uno::Reference< uno::XComponentContext >& xContext ) :
-    ThreadHelpBase( &Application::GetSolarMutex() )
-    , m_pImpl( new ImageManagerImpl(xContext,static_cast< OWeakObject* >(this),true) )
+    m_pImpl( new ImageManagerImpl(xContext,static_cast< OWeakObject* >(this),true) )
 {
 }
 
commit 034781978a669594a9174b54929f2596c05b02df
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 18:11:49 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Iba3daff93e8ff73a16ebfbc51a36b5b9a5a50de9

diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index a724e1d..fe4d63b 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -19,8 +19,6 @@
 
 #include <accelerators/presethandler.hxx>
 #include <uiconfiguration/moduleimagemanager.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-#include <threadhelp/guard.hxx>
 #include <stdtypes.h>
 #include <uielement/constitemcontainer.hxx>
 #include <uielement/rootitemcontainer.hxx>
@@ -65,8 +63,7 @@ using namespace framework;
 
 namespace {
 
-class ModuleUIConfigurationManager : private ThreadHelpBase,   // Struct for right initalization of mutex member! Must be first of baseclasses.
-                                     public cppu::WeakImplHelper3<
+class ModuleUIConfigurationManager : public cppu::WeakImplHelper3<
                                        css::lang::XServiceInfo,
                                        css::lang::XComponent,
                                        css::ui::XModuleUIConfigurationManager2 >
@@ -215,6 +212,7 @@ private:
     OUString                                                                   m_aModuleShortName;
     css::uno::Reference< css::embed::XTransactedObject >      m_xUserRootCommit;
     css::uno::Reference< css::uno::XComponentContext >        m_xContext;
+    osl::Mutex m_mutex;
     ::cppu::OMultiTypeInterfaceContainerHelper                                      m_aListenerContainer;   /// container for ALL Listener
     css::uno::Reference< css::lang::XComponent >              m_xModuleImageManager;
     css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
@@ -848,8 +846,7 @@ void ModuleUIConfigurationManager::impl_Initialize()
 ModuleUIConfigurationManager::ModuleUIConfigurationManager(
         const Reference< XComponentContext >& xContext,
         const css::uno::Sequence< css::uno::Any >& aArguments)
-    : ThreadHelpBase( &Application::GetSolarMutex() )
-    , m_xDefaultConfigStorage( 0 )
+    : m_xDefaultConfigStorage( 0 )
     , m_xUserConfigStorage( 0 )
     , m_bReadOnly( true )
     , m_bModified( false )
@@ -859,7 +856,7 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
     , m_aPropUIName( "UIName" )
     , m_aPropResourceURL( "ResourceURL" )
     , m_xContext( xContext )
-    , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+    , m_aListenerContainer( m_mutex )
 {
     for ( int i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
         m_pStorageHandler[i] = 0;
@@ -869,7 +866,7 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
     m_aUIElements[LAYER_DEFAULT].resize( ::com::sun::star::ui::UIElementType::COUNT );
     m_aUIElements[LAYER_USERDEFINED].resize( ::com::sun::star::ui::UIElementType::COUNT );
 
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if( aArguments.getLength() == 2 && (aArguments[0] >>= m_aModuleShortName) && (aArguments[1] >>= m_aModuleIdentifier))
     {
@@ -939,7 +936,7 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u
     m_aListenerContainer.disposeAndClear( aEvent );
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
     Reference< XComponent > xModuleImageManager( m_xModuleImageManager );
     m_xModuleImageManager.clear();
     Reference< XComponent > xCompMAM( m_xModuleAcceleratorManager, UNO_QUERY );
@@ -954,7 +951,7 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u
     m_bConfigRead = false;
     m_bModified = false;
     m_bDisposed = true;
-    aGuard.unlock();
+    aGuard.clear();
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
 
     try
@@ -970,7 +967,7 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u
 void SAL_CALL ModuleUIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         /* SAFE AREA ----------------------------------------------------------------------------------------------- */
         if ( m_bDisposed )
@@ -990,7 +987,7 @@ void SAL_CALL ModuleUIConfigurationManager::removeEventListener( const Reference
 void SAL_CALL ModuleUIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         /* SAFE AREA ----------------------------------------------------------------------------------------------- */
         if ( m_bDisposed )
@@ -1010,7 +1007,7 @@ void SAL_CALL ModuleUIConfigurationManager::removeConfigurationListener( const R
 // XUIConfigurationManager
 void SAL_CALL ModuleUIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -1071,7 +1068,7 @@ void SAL_CALL ModuleUIConfigurationManager::reset() throw (::com::sun::star::uno
             m_bModified = false;
 
             // Unlock mutex before notify our listeners
-            aGuard.unlock();
+            aGuard.clear();
 
             // Notify our listeners
             sal_uInt32 k = 0;
@@ -1101,7 +1098,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
     if (( ElementType < 0 ) || ( ElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
         throw IllegalArgumentException();
 
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( m_bDisposed )
         throw DisposedException();
 
@@ -1137,7 +1134,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
 
 Reference< XIndexContainer > SAL_CALL ModuleUIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1156,7 +1153,7 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::
         throw IllegalArgumentException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1179,7 +1176,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
         throw IllegalArgumentException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1210,7 +1207,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1247,7 +1244,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
                 aEvent.ReplacedElement <<= xOldSettings;
                 aEvent.Element <<= pDataSettings->xSettings;
 
-                aGuard.unlock();
+                aGuard.clear();
 
                 implts_notifyContainerListener( aEvent, NotifyOp_Replace );
             }
@@ -1295,7 +1292,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
                 aEvent.ReplacedElement <<= pDataSettings->xSettings;
                 aEvent.Element <<= aUIElementData.xSettings;
 
-                aGuard.unlock();
+                aGuard.clear();
 
                 implts_notifyContainerListener( aEvent, NotifyOp_Replace );
             }
@@ -1317,7 +1314,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1358,7 +1355,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
                     aEvent.Element <<= xRemovedSettings;
                     aEvent.ReplacedElement <<= pDefaultDataSettings->xSettings;
 
-                    aGuard.unlock();
+                    aGuard.clear();
 
                     implts_notifyContainerListener( aEvent, NotifyOp_Replace );
                 }
@@ -1372,7 +1369,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
                     aEvent.Source = xThis;
                     aEvent.Element <<= xRemovedSettings;
 
-                    aGuard.unlock();
+                    aGuard.clear();
 
                     implts_notifyContainerListener( aEvent, NotifyOp_Remove );
                 }
@@ -1395,7 +1392,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1436,7 +1433,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
             aEvent.Source = xThis;
             aEvent.Element <<= xInsertSettings;
 
-            aGuard.unlock();
+            aGuard.clear();
 
             implts_notifyContainerListener( aEvent, NotifyOp_Insert );
         }
@@ -1447,7 +1444,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
 
 Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1478,7 +1475,7 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager()
 
 Reference< ui::XAcceleratorConfiguration > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1513,7 +1510,7 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::
         throw IllegalArgumentException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1536,7 +1533,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
         throw IllegalArgumentException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1562,7 +1559,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
 // XUIConfigurationPersistence
 void SAL_CALL ModuleUIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1591,7 +1588,7 @@ void SAL_CALL ModuleUIConfigurationManager::reload() throw (::com::sun::star::un
         m_bModified = false;
 
         // Unlock mutex before notify our listeners
-        aGuard.unlock();
+        aGuard.clear();
 
         // Notify our listeners
         for ( sal_uInt32 j = 0; j < aRemoveNotifyContainer.size(); j++ )
@@ -1603,7 +1600,7 @@ void SAL_CALL ModuleUIConfigurationManager::reload() throw (::com::sun::star::un
 
 void SAL_CALL ModuleUIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1636,7 +1633,7 @@ void SAL_CALL ModuleUIConfigurationManager::store() throw (::com::sun::star::uno
 
 void SAL_CALL ModuleUIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1669,14 +1666,14 @@ void SAL_CALL ModuleUIConfigurationManager::storeToStorage( const Reference< XSt
 
 sal_Bool SAL_CALL ModuleUIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return m_bModified;
 }
 
 sal_Bool SAL_CALL ModuleUIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return m_bReadOnly;
 }
commit 67b4b6b52b5001ee51bf640adaa6243da6c908c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 18:07:28 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I7c2f9205d2fc7017c6eaafec7a46d92524e3104d

diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index f531615..95322ab 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <threadhelp/guard.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <uiconfiguration/imagemanager.hxx>
 #include <uielement/rootitemcontainer.hxx>
 #include <uielement/constitemcontainer.hxx>
@@ -61,8 +59,7 @@ using namespace framework;
 
 namespace {
 
-class UIConfigurationManager :   private ThreadHelpBase,   // Struct for right initalization of mutex member! Must be first of baseclasses.
-                                 public ::cppu::WeakImplHelper2<
+class UIConfigurationManager :   public ::cppu::WeakImplHelper2<
                                         css::lang::XServiceInfo  ,
                                         css::ui::XUIConfigurationManager2 >
 {
@@ -197,6 +194,7 @@ private:
     OUString                                                  m_aPropResourceURL;
     OUString                                                  m_aModuleIdentifier;
     css::uno::Reference< css::uno::XComponentContext >        m_xContext;
+    osl::Mutex m_mutex;
     cppu::OMultiTypeInterfaceContainerHelper                  m_aListenerContainer;   /// container for ALL Listener
     css::uno::Reference< css::lang::XComponent >              m_xImageManager;
     css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAccConfig;
@@ -687,8 +685,7 @@ void UIConfigurationManager::impl_Initialize()
 }
 
 UIConfigurationManager::UIConfigurationManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext ) :
-    ThreadHelpBase( &Application::GetSolarMutex() )
-    , m_xDocConfigStorage( 0 )
+    m_xDocConfigStorage( 0 )
     , m_bReadOnly( true )
     , m_bModified( false )
     , m_bConfigRead( false )
@@ -697,7 +694,7 @@ UIConfigurationManager::UIConfigurationManager( const com::sun::star::uno::Refer
     , m_aPropUIName( "UIName" )
     , m_aPropResourceURL( "ResourceURL" )
     , m_xContext( rxContext )
-    , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+    , m_aListenerContainer( m_mutex )
 {
     // Make sure we have a default initialized entry for every layer and user interface element type!
     // The following code depends on this!
@@ -717,7 +714,7 @@ void SAL_CALL UIConfigurationManager::dispose() throw (::com::sun::star::uno::Ru
     m_aListenerContainer.disposeAndClear( aEvent );
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         try
         {
             if ( m_xImageManager.is() )
@@ -739,7 +736,7 @@ void SAL_CALL UIConfigurationManager::dispose() throw (::com::sun::star::uno::Ru
 void SAL_CALL UIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         /* SAFE AREA ----------------------------------------------------------------------------------------------- */
         if ( m_bDisposed )
@@ -759,7 +756,7 @@ void SAL_CALL UIConfigurationManager::removeEventListener( const Reference< XEve
 void SAL_CALL UIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         /* SAFE AREA ----------------------------------------------------------------------------------------------- */
         if ( m_bDisposed )
@@ -778,7 +775,7 @@ void SAL_CALL UIConfigurationManager::removeConfigurationListener( const Referen
 
 void SAL_CALL UIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -840,7 +837,7 @@ void SAL_CALL UIConfigurationManager::reset() throw (::com::sun::star::uno::Runt
             m_bModified = false;
 
             // Unlock mutex before notify our listeners
-            aGuard.unlock();
+            aGuard.clear();
 
             // Notify our listeners
             for ( sal_uInt32 k = 0; k < aRemoveEventNotifyContainer.size(); k++ )
@@ -867,7 +864,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
     if (( ElementType < 0 ) || ( ElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
         throw IllegalArgumentException();
 
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( m_bDisposed )
         throw DisposedException();
 
@@ -903,7 +900,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
 
 Reference< XIndexContainer > SAL_CALL UIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -940,7 +937,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
         throw IllegalArgumentException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -971,7 +968,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1008,7 +1005,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
             aEvent.ReplacedElement <<= xOldSettings;
             aEvent.Element <<= pDataSettings->xSettings;
 
-            aGuard.unlock();
+            aGuard.clear();
 
             implts_notifyContainerListener( aEvent, NotifyOp_Replace );
         }
@@ -1029,7 +1026,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1064,7 +1061,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
                 aEvent.Source = xThis;
                 aEvent.Element <<= xRemovedSettings;
 
-                aGuard.unlock();
+                aGuard.clear();
 
                 implts_notifyContainerListener( aEvent, NotifyOp_Remove );
             }
@@ -1086,7 +1083,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
         throw IllegalAccessException();
     else
     {
-        Guard aGuard( m_aLock );
+        SolarMutexClearableGuard aGuard;
 
         if ( m_bDisposed )
             throw DisposedException();
@@ -1140,7 +1137,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
             aEvent.Source = xThis;
             aEvent.Element <<= xInsertSettings;
 
-            aGuard.unlock();
+            aGuard.clear();
 
             implts_notifyContainerListener( aEvent, NotifyOp_Insert );
         }
@@ -1176,7 +1173,7 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager() throw
 Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     // SAFE ->
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if (!m_xAccConfig.is()) try
     {
@@ -1200,7 +1197,7 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() thro
 // XUIConfigurationStorage
 void SAL_CALL UIConfigurationManager::setStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1260,7 +1257,7 @@ void SAL_CALL UIConfigurationManager::setStorage( const Reference< XStorage >& S
 
 sal_Bool SAL_CALL UIConfigurationManager::hasStorage() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1271,7 +1268,7 @@ sal_Bool SAL_CALL UIConfigurationManager::hasStorage() throw (::com::sun::star::
 // XUIConfigurationPersistence
 void SAL_CALL UIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1298,7 +1295,7 @@ void SAL_CALL UIConfigurationManager::reload() throw (::com::sun::star::uno::Exc
         m_bModified = false;
 
         // Unlock mutex before notify our listeners
-        aGuard.unlock();
+        aGuard.clear();
 
         // Notify our listeners
         for ( sal_uInt32 j = 0; j < aRemoveNotifyContainer.size(); j++ )
@@ -1310,7 +1307,7 @@ void SAL_CALL UIConfigurationManager::reload() throw (::com::sun::star::uno::Exc
 
 void SAL_CALL UIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1343,7 +1340,7 @@ void SAL_CALL UIConfigurationManager::store() throw (::com::sun::star::uno::Exce
 
 void SAL_CALL UIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -1376,14 +1373,14 @@ void SAL_CALL UIConfigurationManager::storeToStorage( const Reference< XStorage
 
 sal_Bool SAL_CALL UIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return m_bModified;
 }
 
 sal_Bool SAL_CALL UIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return m_bReadOnly;
 }
commit a6e25088b965ba0890e3cbed934241192b7fa683
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 18:01:24 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I82d891fb9910d5f92ad221a6f99f499bdf3d50e3

diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 784a194..ea6704e 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -25,7 +25,6 @@
 */
 #include <vector>
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <stdtypes.h>
 
 #include <com/sun/star/frame/XFrame.hpp>
@@ -74,7 +73,6 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
                        public com::sun::star::ui::XUIConfigurationListener          ,
                        public com::sun::star::lang::XComponent                      ,
                        public com::sun::star::awt::XSystemDependentMenuPeer         ,
-                       public ThreadHelpBase                                        ,
                        public ::cppu::OWeakObject
 {
     protected:
@@ -234,6 +232,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >           m_xUICommandLabels;
         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory > m_xPopupMenuControllerFactory;
         ::std::vector< MenuItemHandler* >                                                      m_aMenuItemHandlerVector;
+        osl::Mutex m_mutex;
         ::cppu::OMultiTypeInterfaceContainerHelper                                             m_aListenerContainer;   /// container for ALL Listener
         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >         m_xDispatchProvider;
         ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager >                m_xDocImageManager;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 52d0fe1..7ea4712 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -22,7 +22,6 @@
 #include <framework/bmkmenu.hxx>
 #include <framework/addonmenu.hxx>
 #include <framework/imageproducer.hxx>
-#include <threadhelp/guard.hxx>
 #include "framework/addonsoptions.hxx"
 #include <classes/fwkresid.hxx>
 #include <classes/menumanager.hxx>
@@ -169,13 +168,13 @@ MenuBarManager::MenuBarManager(
     const Reference< XURLTransformer >& _xURLTransformer,
     const Reference< XDispatchProvider >& rDispatchProvider,
     const OUString& rModuleIdentifier,
-    Menu* pMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
-: ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject()
+    Menu* pMenu, sal_Bool bDelete, sal_Bool bDeleteChildren ):
+    OWeakObject()
     , m_bDisposed( sal_False )
     , m_bRetrieveImages( sal_False )
     , m_bAcceleratorCfg( sal_False )
     , m_bModuleIdentified( sal_False )
-    , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+    , m_aListenerContainer( m_mutex )
     , m_xContext(rxContext)
     , m_xURLTransformer(_xURLTransformer)
     , m_sIconTheme( SvtMiscOptions().GetIconTheme() )
@@ -190,14 +189,13 @@ MenuBarManager::MenuBarManager(
     const Reference< XURLTransformer >& _xURLTransformer,
     AddonMenu* pAddonMenu,
     sal_Bool bDelete,
-    sal_Bool bDeleteChildren )
-:   ThreadHelpBase( &Application::GetSolarMutex() )
-    , OWeakObject()
+    sal_Bool bDeleteChildren ):
+    OWeakObject()
     , m_bDisposed( sal_False )
     , m_bRetrieveImages( sal_True )
     , m_bAcceleratorCfg( sal_False )
     , m_bModuleIdentified( sal_False )
-    , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+    , m_aListenerContainer( m_mutex )
     , m_xContext(rxContext)
     , m_xURLTransformer(_xURLTransformer)
     , m_sIconTheme( SvtMiscOptions().GetIconTheme() )
@@ -211,14 +209,13 @@ MenuBarManager::MenuBarManager(
     const Reference< XURLTransformer >& _xURLTransformer,
     AddonPopupMenu* pAddonPopupMenu,
     sal_Bool bDelete,
-    sal_Bool bDeleteChildren )
-:     ThreadHelpBase( &Application::GetSolarMutex() )
-    , OWeakObject()
+    sal_Bool bDeleteChildren ):
+    OWeakObject()
     , m_bDisposed( sal_False )
     , m_bRetrieveImages( sal_True )
     , m_bAcceleratorCfg( sal_False )
     , m_bModuleIdentified( sal_False )
-    , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+    , m_aListenerContainer( m_mutex )
     , m_xContext(rxContext)
     , m_xURLTransformer(_xURLTransformer)
     , m_sIconTheme( SvtMiscOptions().GetIconTheme() )
@@ -258,7 +255,7 @@ void SAL_CALL MenuBarManager::release() throw()
 
 Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) throw (RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard aSolarGuard;
 
     if ( m_bDisposed )
         throw com::sun::star::lang::DisposedException();
@@ -267,8 +264,6 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*Proces
 
     if ( m_pVCLMenu )
     {
-        SolarMutexGuard aSolarGuard;
-
         SystemMenuData aSystemMenuData;
         aSystemMenuData.nSize = sizeof( SystemMenuData );
 
@@ -335,7 +330,7 @@ void SAL_CALL MenuBarManager::dispose() throw( RuntimeException, std::exception
     m_aListenerContainer.disposeAndClear( aEvent );
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         Destroy();
         m_bDisposed = sal_True;
 
@@ -379,7 +374,7 @@ void SAL_CALL MenuBarManager::dispose() throw( RuntimeException, std::exception
 
 void SAL_CALL MenuBarManager::addEventListener( const Reference< XEventListener >& xListener ) throw( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -390,7 +385,7 @@ void SAL_CALL MenuBarManager::addEventListener( const Reference< XEventListener
 
 void SAL_CALL MenuBarManager::removeEventListener( const Reference< XEventListener >& xListener ) throw( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
 }
@@ -398,7 +393,7 @@ void SAL_CALL MenuBarManager::removeEventListener( const Reference< XEventListen
 void SAL_CALL MenuBarManager::elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event )
 throw (RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -427,7 +422,7 @@ throw (RuntimeException, std::exception)
 void SAL_CALL MenuBarManager::frameAction( const FrameActionEvent& Action )
 throw ( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw com::sun::star::lang::DisposedException();
@@ -452,8 +447,6 @@ throw ( RuntimeException, std::exception )
 
     SolarMutexGuard aSolarGuard;
     {
-        Guard aGuard( m_aLock );
-
         if ( m_bDisposed )
             return;
 
@@ -541,7 +534,7 @@ throw ( RuntimeException, std::exception )
 // Helper to retrieve own structure from item ID
 MenuBarManager::MenuItemHandler* MenuBarManager::GetMenuItemHandler( sal_uInt16 nItemId )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     std::vector< MenuItemHandler* >::iterator p;
     for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); ++p )
@@ -574,7 +567,7 @@ void MenuBarManager::RequestImages()
 // Helper to reset objects to prepare shutdown
 void MenuBarManager::RemoveListener()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Check service manager reference. Remove listener can be called due
     // to a disposing call from the frame and therefore we already removed
@@ -600,7 +593,6 @@ void MenuBarManager::RemoveListener()
             {
                 {
                     // Remove popup menu from menu structure
-                    SolarMutexGuard aGuard2;
                     m_pVCLMenu->SetPopupMenu( pItemHandler->nItemId, 0 );
                 }
 
@@ -657,7 +649,7 @@ void SAL_CALL MenuBarManager::disposing( const EventObject& Source ) throw ( Run
 {
     MenuItemHandler* pMenuItemDisposing = NULL;
 
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     std::vector< MenuItemHandler* >::iterator p;
     for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); ++p )
@@ -696,7 +688,6 @@ void SAL_CALL MenuBarManager::disposing( const EventObject& Source ) throw ( Run
                 {
                     // Remove popup menu from menu structure as we release our reference to
                     // the controller.
-                    SolarMutexGuard aGuard2;
                     m_pVCLMenu->SetPopupMenu( pMenuItemDisposing->nItemId, 0 );
                 }
 
@@ -802,7 +793,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
         sal_Bool bShowMenuImages     = rSettings.GetUseImagesInMenus();
         sal_Bool bHasDisabledEntries = SvtCommandOptions().HasEntries( SvtCommandOptions::CMDOPTION_DISABLED );
 
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         sal_uInt16 nFlag = pMenu->GetMenuFlags();
         if ( bDontHide )
@@ -1007,7 +998,7 @@ IMPL_LINK( MenuBarManager, Deactivate, Menu *, pMenu )
 
 IMPL_LINK( MenuBarManager, AsyncSettingsHdl, Timer*,)
 {
-    SolarMutexGuard aGuard;
+    SolarMutexGuard g;
     Reference< XInterface > xSelfHold(
         static_cast< ::cppu::OWeakObject* >( this ), UNO_QUERY_THROW );
 
@@ -1028,7 +1019,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
     Reference< XDispatch >  xDispatch;
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         sal_uInt16 nCurItemId = pMenu->GetCurItemId();
         sal_uInt16 nCurPos    = pMenu->GetItemPos( nCurItemId );
@@ -1822,8 +1813,7 @@ void MenuBarManager::MergeAddonMenus(
 
 void MenuBarManager::SetItemContainer( const Reference< XIndexAccess >& rItemContainer )
 {
-
-    Guard aGuard( m_aLock );
+    SolarMutexGuard aSolarMutexGuard;
 
     Reference< XFrame > xFrame = m_xFrame;
 
@@ -1843,8 +1833,6 @@ void MenuBarManager::SetItemContainer( const Reference< XIndexAccess >& rItemCon
 
     // Clear MenuBarManager structures
     {
-        SolarMutexGuard aSolarMutexGuard;
-
         // Check active state as we cannot change our VCL menu during activation by the user
         if ( m_bActive )
         {
commit c788c20fb235241624f3cab4698dfbdb20213608
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:56:10 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ib6effb226472e52ee90434e96d7fe446e9265cc2

diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx
index a975753..1b080be 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSBARMANAGER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSBARMANAGER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -44,8 +43,7 @@ namespace framework
 {
 
 class FrameworkStatusBar;
-class StatusBarManager : public ThreadHelpBase,
-                         public ::cppu::WeakImplHelper3<
+class StatusBarManager : public ::cppu::WeakImplHelper3<
                                    css::frame::XFrameActionListener,
                                    css::lang::XComponent,
                                    css::ui::XUIConfigurationListener >
@@ -111,6 +109,7 @@ class StatusBarManager : public ThreadHelpBase,
         com::sun::star::uno::Reference< com::sun::star::frame::XFrame >                                 m_xFrame;
         com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >                        m_xUICommandLabels;
         StatusBarControllerMap                                                                          m_aControllerMap;
+        osl::Mutex m_mutex;
         ::cppu::OMultiTypeInterfaceContainerHelper                                                      m_aListenerContainer;   /// container for ALL Listener
         ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >                      m_xContext;
         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory >               m_xStatusbarControllerFactory;
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index 1de14e4..89d8af0 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -20,8 +20,6 @@
 #include <uielement/statusbarmanager.hxx>
 #include <uielement/genericstatusbarcontroller.hxx>
 
-#include <threadhelp/threadhelpbase.hxx>
-#include <threadhelp/guard.hxx>
 #include <framework/sfxhelperfunctions.hxx>
 #include <framework/addonsoptions.hxx>
 #include <uielement/statusbarmerger.hxx>
@@ -134,7 +132,6 @@ StatusBarManager::StatusBarManager(
     const uno::Reference< frame::XFrame >& rFrame,
     const OUString& rResourceName,
     StatusBar* pStatusBar ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_bDisposed( sal_False ),
     m_bFrameActionRegistered( sal_False ),
     m_bUpdateControllers( sal_False ),
@@ -142,7 +139,7 @@ StatusBarManager::StatusBarManager(
     m_pStatusBar( pStatusBar ),
     m_aResourceName( rResourceName ),
     m_xFrame( rFrame ),
-    m_aListenerContainer( m_aLock.getShareableOslMutex() ),
+    m_aListenerContainer( m_mutex ),
     m_xContext( rxContext )
 {
 
@@ -159,14 +156,14 @@ StatusBarManager::~StatusBarManager()
 
 StatusBar* StatusBarManager::GetStatusBar() const
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     return m_pStatusBar;
 }
 
 void StatusBarManager::frameAction( const frame::FrameActionEvent& Action )
 throw ( uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( Action.Action == frame::FrameAction_CONTEXT_CHANGED )
         UpdateControllers();
 }
@@ -174,7 +171,7 @@ throw ( uno::RuntimeException, std::exception )
 void SAL_CALL StatusBarManager::disposing( const lang::EventObject& Source ) throw ( uno::RuntimeException, std::exception )
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         if ( m_bDisposed )
             return;
     }
@@ -182,7 +179,7 @@ void SAL_CALL StatusBarManager::disposing( const lang::EventObject& Source ) thr
     RemoveControllers();
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         if ( Source.Source == uno::Reference< uno::XInterface >( m_xFrame, uno::UNO_QUERY ))
             m_xFrame.clear();
 
@@ -200,7 +197,7 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException, std::exc
     m_aListenerContainer.disposeAndClear( aEvent );
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         if ( !m_bDisposed )
         {
             RemoveControllers();
@@ -240,7 +237,7 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException, std::exc
 
 void SAL_CALL StatusBarManager::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw( uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -259,7 +256,7 @@ void SAL_CALL StatusBarManager::removeEventListener( const uno::Reference< lang:
 // XUIConfigurationListener
 void SAL_CALL StatusBarManager::elementInserted( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -267,7 +264,7 @@ void SAL_CALL StatusBarManager::elementInserted( const css::ui::ConfigurationEve
 
 void SAL_CALL StatusBarManager::elementRemoved( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -275,7 +272,7 @@ void SAL_CALL StatusBarManager::elementRemoved( const css::ui::ConfigurationEven
 
 void SAL_CALL StatusBarManager::elementReplaced( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -295,7 +292,7 @@ void StatusBarManager::UpdateControllers()
 
 void StatusBarManager::RemoveControllers()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -426,8 +423,7 @@ void StatusBarManager::AddFrameActionListener()
 
 void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAccess >& rItemContainer )
 {
-
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed || !m_pStatusBar )
         return;
@@ -554,7 +550,7 @@ void StatusBarManager::StateChanged( StateChangedType )
 
 void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     if ((( rDCEvt.GetType() == DATACHANGED_SETTINGS         ) ||
          ( rDCEvt.GetType() == DATACHANGED_FONTS            ) ||
@@ -568,7 +564,7 @@ void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
             xPropSet->getPropertyValue("LayoutManager") >>= xLayoutManager;
         if ( xLayoutManager.is() )
         {
-            aGuard.unlock();
+            aGuard.clear();
             xLayoutManager->doLayout();
         }
     }
@@ -576,7 +572,7 @@ void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
 
 void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
 
     if ( m_bDisposed )
         return;
@@ -595,7 +591,7 @@ void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
                                   rUDEvt.GetRect().Top(),
                                   rUDEvt.GetRect().GetWidth(),
                                   rUDEvt.GetRect().GetHeight() );
-            aGuard.unlock();
+            aGuard.clear();
             xController->paint( xGraphics, aRect, rUDEvt.GetStyle() );
         }
     }
@@ -603,7 +599,7 @@ void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
 
 void StatusBarManager::Command( const CommandEvent& rEvt )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -633,7 +629,7 @@ void StatusBarManager::MouseMove( const MouseEvent& rMEvt )
 
 void StatusBarManager::MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL frame::XStatusbarController::*_pMethod )(const ::com::sun::star::awt::MouseEvent&))
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bDisposed )
     {
@@ -667,7 +663,7 @@ void StatusBarManager::MouseButtonUp( const MouseEvent& rMEvt )
 
 IMPL_LINK_NOARG(StatusBarManager, Click)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -690,7 +686,7 @@ IMPL_LINK_NOARG(StatusBarManager, Click)
 
 IMPL_LINK_NOARG(StatusBarManager, DoubleClick)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
commit 21228ee04042b87a2c9c971d564a8b56e74c120a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:51:33 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I43da5d468769c7e2f4801979baa2ee3c7868b639

diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 2213803..d96d895 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMANAGER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMANAGER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -66,8 +65,7 @@ typedef ::cppu::WeakImplHelper4<
            ::com::sun::star::ui::XUIConfigurationListener
         > ToolbarManager_Base;
 
-class ToolBarManager : public ToolbarManager_Base,
-                       public ThreadHelpBase
+class ToolBarManager : public ToolbarManager_Base
 {
     public:
         ToolBarManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
@@ -198,6 +196,7 @@ class ToolBarManager : public ToolbarManager_Base,
         com::sun::star::uno::Reference< com::sun::star::frame::XFrame >                        m_xFrame;
         com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >               m_xUICommandLabels;
         ToolBarControllerMap                                                                   m_aControllerMap;
+        osl::Mutex m_mutex;
         ::cppu::OMultiTypeInterfaceContainerHelper                                             m_aListenerContainer;   /// container for ALL Listener
         ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >             m_xContext;
         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory > m_xToolbarControllerFactory;
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 42b22c6..4137339 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -145,7 +145,7 @@ void SAL_CALL AddonsToolBarManager::dispose() throw( RuntimeException, std::exce
 
     {
         // Remove addon specific data from toolbar items.
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         for ( sal_uInt16 n = 0; n < m_pToolBar->GetItemCount(); n++ )
         {
             sal_uInt16 nId( m_pToolBar->GetItemId( n ) );
@@ -201,7 +201,7 @@ void AddonsToolBarManager::RefreshImages()
 
 void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue > >& rAddonToolbar )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -422,7 +422,7 @@ IMPL_LINK_NOARG(AddonsToolBarManager, DoubleClick)
 
 IMPL_LINK_NOARG(AddonsToolBarManager, Command)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index e70736f..d6e1fd7 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -20,7 +20,6 @@
 #include <uielement/toolbarmanager.hxx>
 
 #include <uielement/generictoolbarcontroller.hxx>
-#include <threadhelp/guard.hxx>
 #include "services.h"
 #include "general.h"
 #include "properties.h"
@@ -186,7 +185,6 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
                                 const Reference< XFrame >& rFrame,
                                 const OUString& rResourceName,
                                 ToolBox* pToolBar ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_bDisposed( false ),
     m_bSmallSymbols( !SvtMiscOptions().AreCurrentSymbolsLarge() ),
     m_bModuleIdentified( false ),
@@ -199,7 +197,7 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
     m_pToolBar( pToolBar ),
     m_aResourceName( rResourceName ),
     m_xFrame( rFrame ),
-    m_aListenerContainer( m_aLock.getShareableOslMutex() ),
+    m_aListenerContainer( m_mutex ),
     m_xContext( rxContext ),
     m_sIconTheme( SvtMiscOptions().GetIconTheme() ),
     m_bAcceleratorCfg( sal_False )
@@ -261,7 +259,7 @@ ToolBarManager::~ToolBarManager()
 void ToolBarManager::Destroy()
 {
     OSL_ASSERT( m_pToolBar != 0 );
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( m_bAddedToTaskPaneList )
     {
         Window* pWindow = m_pToolBar;
@@ -305,13 +303,13 @@ void ToolBarManager::Destroy()
 
 ToolBox* ToolBarManager::GetToolBar() const
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     return m_pToolBar;
 }
 
 void ToolBarManager::CheckAndUpdateImages()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     sal_Bool bRefreshImages = sal_False;
 
     SvtMiscOptions aMiscOptions;
@@ -336,7 +334,7 @@ void ToolBarManager::CheckAndUpdateImages()
 
 void ToolBarManager::RefreshImages()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     sal_Bool  bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() );
     for ( sal_uInt16 nPos = 0; nPos < m_pToolBar->GetItemCount(); nPos++ )
@@ -362,7 +360,7 @@ void ToolBarManager::RefreshImages()
 
 void ToolBarManager::UpdateImageOrientation()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_xUICommandLabels.is() )
     {
@@ -485,7 +483,7 @@ void ToolBarManager::UpdateController( ::com::sun::star::uno::Reference< ::com::
 void ToolBarManager::frameAction( const FrameActionEvent& Action )
 throw ( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( Action.Action == FrameAction_CONTEXT_CHANGED )
         m_aAsyncUpdateControllersTimer.Start();
 }
@@ -493,7 +491,7 @@ throw ( RuntimeException, std::exception )
 void SAL_CALL ToolBarManager::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
 throw ( ::com::sun::star::uno::RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
     if ( m_bDisposed )
         return;
 
@@ -511,7 +509,7 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
 void SAL_CALL ToolBarManager::disposing( const EventObject& Source ) throw ( RuntimeException, std::exception )
 {
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         if ( m_bDisposed )
             return;
     }
@@ -519,7 +517,7 @@ void SAL_CALL ToolBarManager::disposing( const EventObject& Source ) throw ( Run
     RemoveControllers();
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
         if ( m_xDocImageManager.is() )
         {
             try
@@ -573,7 +571,7 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException, std::exception
     m_aListenerContainer.disposeAndClear( aEvent );
 
     {
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         // stop timer to prevent timer events after dispose
         m_aAsyncUpdateControllersTimer.Stop();
@@ -647,7 +645,7 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException, std::exception
 
 void SAL_CALL ToolBarManager::addEventListener( const Reference< XEventListener >& xListener ) throw( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -673,7 +671,7 @@ void SAL_CALL ToolBarManager::elementRemoved( const ::com::sun::star::ui::Config
 }
 void ToolBarManager::impl_elementChanged(bool _bRemove,const ::com::sun::star::ui::ConfigurationEvent& Event )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     if ( m_bDisposed )
@@ -745,7 +743,7 @@ void SAL_CALL ToolBarManager::elementReplaced( const ::com::sun::star::ui::Confi
 
 void ToolBarManager::RemoveControllers()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -1151,7 +1149,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
     OString aTbxName = OUStringToOString( m_aResourceName, RTL_TEXTENCODING_ASCII_US );
     SAL_INFO( "fwk.uielement", "framework (cd100003) ::ToolBarManager::FillToolbar " << aTbxName.getStr() );
 
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return;
@@ -1503,7 +1501,7 @@ void ToolBarManager::RequestImages()
 
 void ToolBarManager::notifyRegisteredControllers( const OUString& aUIElementName, const OUString& aCommand )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexClearableGuard aGuard;
     if ( !m_aSubToolBarControllerMap.empty() )
     {
         SubToolBarToSubToolBarControllerMap::const_iterator pIter =
@@ -1515,7 +1513,7 @@ void ToolBarManager::notifyRegisteredControllers( const OUString& aUIElementName
             if ( !rSubToolBarVector.empty() )
             {
                 SubToolBarControllerVector aNotifyVector = rSubToolBarVector;
-                aGuard.unlock();
+                aGuard.clear();
 
                 const sal_uInt32 nCount = aNotifyVector.size();
                 for ( sal_uInt32 i=0; i < nCount; i++ )
@@ -1540,7 +1538,7 @@ void ToolBarManager::notifyRegisteredControllers( const OUString& aUIElementName
 }
 long ToolBarManager::HandleClick(void ( SAL_CALL XToolbarController::*_pClick )())
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -1564,7 +1562,7 @@ IMPL_LINK_NOARG(ToolBarManager, Click)
 
 IMPL_LINK_NOARG(ToolBarManager, DropdownClick)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -1621,7 +1619,7 @@ void ToolBarManager::ImplClearPopupMenu( ToolBox *pToolBar )
 
 IMPL_LINK( ToolBarManager, MenuDeactivate, Menu*, pMenu )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -1786,7 +1784,7 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
 
 IMPL_LINK( ToolBarManager, Command, CommandEvent*, pCmdEvt )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -1807,7 +1805,7 @@ IMPL_LINK( ToolBarManager, Command, CommandEvent*, pCmdEvt )
 
 IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar )
 {
-   Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
@@ -1828,7 +1826,7 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
     {
         // The guard must be in its own context as the we can get destroyed when our
         // own xInterface reference get destroyed!
-        Guard aGuard( m_aLock );
+        SolarMutexGuard g;
 
         if ( m_bDisposed )
             return 1;
@@ -2085,7 +2083,7 @@ IMPL_LINK_NOARG(ToolBarManager, AsyncUpdateControllersHdl)
     // own xInterface reference get destroyed!
     Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
 
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         return 1;
commit 112e9c641bb6e30b704c6c3c574c3f8b2e996d99
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:45:43 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ib414409d7f7a3bdfba6dbeeab0d8c1e8e2084ceb

diff --git a/framework/source/uifactory/addonstoolbarfactory.cxx b/framework/source/uifactory/addonstoolbarfactory.cxx
index 6a2668e..3dac557 100644
--- a/framework/source/uifactory/addonstoolbarfactory.cxx
+++ b/framework/source/uifactory/addonstoolbarfactory.cxx
@@ -18,8 +18,6 @@
  */
 
 #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>
@@ -53,8 +51,7 @@ using namespace framework;
 
 namespace {
 
-class AddonsToolBarFactory :  protected ThreadHelpBase,   // Struct for right initalization of mutex member! Must be first of baseclasses.
-                              public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
+class AddonsToolBarFactory :  public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
                                                               css::ui::XUIElementFactory >
 {
 public:
@@ -94,8 +91,7 @@ private:
 
 AddonsToolBarFactory::AddonsToolBarFactory(
     const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) :
-    ThreadHelpBase( &Application::GetSolarMutex() )
-    , m_xContext( xContext )
+    m_xContext( xContext )
     , m_xModuleManager( ModuleManager::create( xContext ) )
 {
 }
@@ -180,8 +176,7 @@ throw ( ::com::sun::star::container::NoSuchElementException,
         ::com::sun::star::lang::IllegalArgumentException,
         ::com::sun::star::uno::RuntimeException, std::exception )
 {
-    // SAFE
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     Sequence< Sequence< PropertyValue > >   aConfigData;
     Reference< XFrame >                     xFrame;
commit be370b4f70d79e17d728ac6289c0558171fe401a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:44:03 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: I018fccbb1546978047f898b4c0107b613d782a6b

diff --git a/framework/inc/xml/acceleratorconfigurationreader.hxx b/framework/inc/xml/acceleratorconfigurationreader.hxx
index 19f930a..95e5f7f 100644
--- a/framework/inc/xml/acceleratorconfigurationreader.hxx
+++ b/framework/inc/xml/acceleratorconfigurationreader.hxx
@@ -23,7 +23,6 @@
 #include <accelerators/acceleratorcache.hxx>
 #include <accelerators/keymapping.hxx>
 #include <macros/xinterface.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <general.h>
 
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -36,8 +35,7 @@
 
 namespace framework{
 
-class AcceleratorConfigurationReader : private ThreadHelpBase
-                                     , public ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler >
+class AcceleratorConfigurationReader : public ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler >
 {
 
     // const, types
diff --git a/framework/source/xml/acceleratorconfigurationreader.cxx b/framework/source/xml/acceleratorconfigurationreader.cxx
index 54e87ea..a123265 100644
--- a/framework/source/xml/acceleratorconfigurationreader.cxx
+++ b/framework/source/xml/acceleratorconfigurationreader.cxx
@@ -58,8 +58,7 @@ namespace framework{
 
 
 AcceleratorConfigurationReader::AcceleratorConfigurationReader(AcceleratorCache& rContainer)
-    : ThreadHelpBase          (&Application::GetSolarMutex())
-    , m_rContainer            (rContainer                   )
+    : m_rContainer            (rContainer                   )
     , m_bInsideAcceleratorList(sal_False                    )
     , m_bInsideAcceleratorItem(sal_False                    )
 {
commit fab2a35de66230b799194b8dbbdc314b0cff296d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:26:52 2014 +0100

    Access safe members directly
    
    Change-Id: I048bc4ba4e1fc3c7b0dab55cc8e5818086cb70c7

diff --git a/framework/inc/xml/acceleratorconfigurationwriter.hxx b/framework/inc/xml/acceleratorconfigurationwriter.hxx
index 00190cb..c6c48d1 100644
--- a/framework/inc/xml/acceleratorconfigurationwriter.hxx
+++ b/framework/inc/xml/acceleratorconfigurationwriter.hxx
@@ -22,7 +22,6 @@
 
 #include <accelerators/acceleratorcache.hxx>
 #include <accelerators/keymapping.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <general.h>
 
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -32,7 +31,7 @@
 
 namespace framework{
 
-class AcceleratorConfigurationWriter : private ThreadHelpBase
+class AcceleratorConfigurationWriter
 {
 
     // member
diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx
index 82f98c1..c495c29 100644
--- a/framework/source/xml/acceleratorconfigurationwriter.cxx
+++ b/framework/source/xml/acceleratorconfigurationwriter.cxx
@@ -20,7 +20,6 @@
 #include <xml/acceleratorconfigurationwriter.hxx>
 
 #include <acceleratorconst.h>
-#include <threadhelp/guard.hxx>
 
 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
 #include <com/sun/star/xml/sax/XAttributeList.hpp>
@@ -38,8 +37,7 @@ namespace framework{
 
 AcceleratorConfigurationWriter::AcceleratorConfigurationWriter(const AcceleratorCache&                                       rContainer,
                                                                const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig   )
-    : ThreadHelpBase(&Application::GetSolarMutex())
-    , m_xConfig     (xConfig                      )
+    : m_xConfig     (xConfig                      )
     , m_rContainer  (rContainer                   )
 {
 }
@@ -52,15 +50,8 @@ AcceleratorConfigurationWriter::~AcceleratorConfigurationWriter()
 
 void AcceleratorConfigurationWriter::flush()
 {
-    // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
-
-    css::uno::Reference< css::xml::sax::XDocumentHandler >         xCFG        = m_xConfig;
     css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtendedCFG(m_xConfig, css::uno::UNO_QUERY_THROW);
 
-    aReadLock.unlock();
-    // <- SAFE ----------------------------------
-
     // prepare attribute list
     ::comphelper::AttributeList* pAttribs = new ::comphelper::AttributeList;
     css::uno::Reference< css::xml::sax::XAttributeList > xAttribs(static_cast< css::xml::sax::XAttributeList* >(pAttribs), css::uno::UNO_QUERY);
@@ -69,13 +60,13 @@ void AcceleratorConfigurationWriter::flush()
     pAttribs->AddAttribute(AL_XMLNS_XLINK, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_XLINK);
 
     // generate xml
-    xCFG->startDocument();
+    xExtendedCFG->startDocument();
 
     xExtendedCFG->unknown(DOCTYPE_ACCELERATORS);
-    xCFG->ignorableWhitespace(OUString());
+    xExtendedCFG->ignorableWhitespace(OUString());
 
-    xCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs);
-    xCFG->ignorableWhitespace(OUString());
+    xExtendedCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs);
+    xExtendedCFG->ignorableWhitespace(OUString());
 
     // TODO think about threadsafe using of cache
     AcceleratorCache::TKeyList                 lKeys = m_rContainer.getAllKeys();
@@ -86,7 +77,7 @@ void AcceleratorConfigurationWriter::flush()
     {
         const css::awt::KeyEvent& rKey     = *pKey;
         const OUString&    rCommand = m_rContainer.getCommandByKey(rKey);
-        impl_ts_writeKeyCommandPair(rKey, rCommand, xCFG);
+        impl_ts_writeKeyCommandPair(rKey, rCommand, xExtendedCFG);
     }
 
     /* TODO write key-command list
@@ -95,10 +86,10 @@ void AcceleratorConfigurationWriter::flush()
         WriteAcceleratorItem( *p );
     */
 
-    xCFG->ignorableWhitespace(OUString());
-    xCFG->endElement(AL_ELEMENT_ACCELERATORLIST);
-    xCFG->ignorableWhitespace(OUString());
-    xCFG->endDocument();
+    xExtendedCFG->ignorableWhitespace(OUString());
+    xExtendedCFG->endElement(AL_ELEMENT_ACCELERATORLIST);
+    xExtendedCFG->ignorableWhitespace(OUString());
+    xExtendedCFG->endDocument();
 }
 
 
commit f02e6d3de7d26d4ac3fe6cfcb0d75aafeb5466d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 19 17:23:34 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Id6421432be5b9220463a9b5be38b215e1e3b7563

diff --git a/framework/inc/xml/imagesdocumenthandler.hxx b/framework/inc/xml/imagesdocumenthandler.hxx
index 3791b3f..f6e6634 100644
--- a/framework/inc/xml/imagesdocumenthandler.hxx
+++ b/framework/inc/xml/imagesdocumenthandler.hxx
@@ -25,7 +25,6 @@
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 
 #include <xml/imagesconfiguration.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <rtl/ustring.hxx>
 #include <cppuhelper/implbase1.hxx>
 
@@ -37,8 +36,7 @@ namespace framework{
 
 // Hash code function for using in all hash maps of follow implementation.
 
-class OReadImagesDocumentHandler : private ThreadHelpBase,  // Struct for right initalization of lock member! Must be first of baseclasses.
-                                   public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
+class OReadImagesDocumentHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
 {
     public:
         enum Image_XML_Entry
@@ -140,7 +138,7 @@ class OReadImagesDocumentHandler : private ThreadHelpBase,  // Struct for right
         ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >    m_xLocator;
 };
 
-class OWriteImagesDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
+class OWriteImagesDocumentHandler
 {
     public:
         OWriteImagesDocumentHandler(
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index 610b580..79bb0b6 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 
-#include <threadhelp/guard.hxx>
 #include <xml/imagesdocumenthandler.hxx>
 
 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
@@ -102,7 +101,6 @@ ImageXMLEntryProperty ImagesEntries[OReadImagesDocumentHandler::IMG_XML_ENTRY_CO
 
 
 OReadImagesDocumentHandler::OReadImagesDocumentHandler( ImageListsDescriptor& aItems ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_aImageList( aItems ),
     m_pImages( 0 ),
     m_pExternalImages( 0 )
@@ -152,7 +150,7 @@ throw ( SAXException, RuntimeException, std::exception )
 void SAL_CALL OReadImagesDocumentHandler::endDocument(void)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if (( m_bImageContainerStartFound && !m_bImageContainerEndFound ) ||
         ( !m_bImageContainerStartFound && m_bImageContainerEndFound )    )
@@ -169,7 +167,7 @@ void SAL_CALL OReadImagesDocumentHandler::startElement(
               RuntimeException,
               std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     ImageHashMap::const_iterator pImageEntry = m_aImageMap.find( aName ) ;
     if ( pImageEntry != m_aImageMap.end() )
@@ -503,7 +501,7 @@ void SAL_CALL OReadImagesDocumentHandler::endElement(const OUString& aName)
           RuntimeException,
           std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     ImageHashMap::const_iterator pImageEntry = m_aImageMap.find( aName ) ;
     if ( pImageEntry != m_aImageMap.end() )
@@ -579,16 +577,13 @@ void SAL_CALL OReadImagesDocumentHandler::setDocumentLocator(
     const Reference< XLocator > &xLocator)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
-
+    SolarMutexGuard g;
     m_xLocator = xLocator;
 }
 
 OUString OReadImagesDocumentHandler::getErrorLineString()
 {
-    Guard aGuard( m_aLock );
-
-
+    SolarMutexGuard g;
     if ( m_xLocator.is() )
     {
         OUStringBuffer buffer("Line: ");
@@ -608,7 +603,6 @@ OUString OReadImagesDocumentHandler::getErrorLineString()
 OWriteImagesDocumentHandler::OWriteImagesDocumentHandler(
     const ImageListsDescriptor& aItems,
     Reference< XDocumentHandler > rWriteDocumentHandler ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_aImageListsItems( aItems ),
     m_xWriteDocumentHandler( rWriteDocumentHandler )
 {
@@ -628,7 +622,7 @@ OWriteImagesDocumentHandler::~OWriteImagesDocumentHandler()
 void OWriteImagesDocumentHandler::WriteImagesDocument() throw
 ( SAXException, RuntimeException )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     m_xWriteDocumentHandler->startDocument();
 


More information about the Libreoffice-commits mailing list