[Libreoffice-commits] core.git: 18 commits - framework/inc framework/source include/oox ios/experimental

Stephan Bergmann sbergman at redhat.com
Tue Mar 18 07:27:23 PDT 2014


 framework/inc/classes/actiontriggerseparatorpropertyset.hxx                      |    4 
 framework/inc/classes/imagewrapper.hxx                                           |    3 
 framework/inc/helper/dockingareadefaultacceptor.hxx                              |    4 
 framework/inc/helper/ocomponentaccess.hxx                                        |    7 
 framework/inc/helper/ocomponentenumeration.hxx                                   |    7 
 framework/inc/helper/oframes.hxx                                                 |    4 
 framework/inc/helper/persistentwindowstate.hxx                                   |    9 
 framework/inc/helper/propertysetcontainer.hxx                                    |    2 
 framework/inc/helper/tagwindowasmodified.hxx                                     |    9 
 framework/inc/helper/titlebarupdate.hxx                                          |    6 
 framework/inc/helper/uiconfigelementwrapperbase.hxx                              |    4 
 framework/inc/helper/uielementwrapperbase.hxx                                    |    4 
 framework/inc/helper/vclstatusindicator.hxx                                      |    4 
 framework/inc/xml/saxnamespacefilter.hxx                                         |    3 
 framework/inc/xml/statusbardocumenthandler.hxx                                   |    5 
 framework/inc/xml/toolboxdocumenthandler.hxx                                     |    5 
 framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx               |    4 
 framework/source/fwe/classes/imagewrapper.cxx                                    |    3 
 framework/source/fwe/classes/rootactiontriggercontainer.cxx                      |   10 -
 framework/source/fwe/helper/propertysetcontainer.cxx                             |   14 -
 framework/source/fwe/xml/saxnamespacefilter.cxx                                  |    1 
 framework/source/fwe/xml/statusbardocumenthandler.cxx                            |   15 -
 framework/source/fwe/xml/toolboxdocumenthandler.cxx                              |   15 -
 framework/source/helper/dockingareadefaultacceptor.cxx                           |   23 --
 framework/source/helper/ocomponentaccess.cxx                                     |   13 -
 framework/source/helper/ocomponentenumeration.cxx                                |   21 --
 framework/source/helper/oframes.cxx                                              |   25 --
 framework/source/helper/persistentwindowstate.cxx                                |   35 +--
 framework/source/helper/tagwindowasmodified.cxx                                  |   81 +++-----
 framework/source/helper/titlebarupdate.cxx                                       |   41 +---
 framework/source/helper/uiconfigelementwrapperbase.cxx                           |   22 +-
 framework/source/helper/uielementwrapperbase.cxx                                 |    8 
 framework/source/helper/vclstatusindicator.cxx                                   |  100 ++--------
 framework/source/uielement/addonstoolbarwrapper.cxx                              |    8 
 framework/source/uielement/menubarwrapper.cxx                                    |   15 -
 framework/source/uielement/progressbarwrapper.cxx                                |   20 --
 framework/source/uielement/statusbarwrapper.cxx                                  |    8 
 framework/source/uielement/toolbarwrapper.cxx                                    |   20 +-
 framework/source/uifactory/addonstoolbarfactory.cxx                              |    1 
 include/oox/dump/dumperbase.hxx                                                  |    2 
 ios/experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj/project.pbxproj     |    6 
 ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.h                 |    2 
 ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m                 |   51 ++++-
 ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.h |   19 +
 ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.m |   59 +++++
 ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledLibreOffice-Info.plist   |    2 
 ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.h                          |    4 
 ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm                         |   13 -
 48 files changed, 350 insertions(+), 391 deletions(-)

New commits:
commit afe84a3dbbe02b12b113400499a0967e8a2ffab7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 15:17:58 2014 +0100

    loplugin:passstringbyref
    
    Change-Id: I4de62139cc479ee1f96988b7f2c2f5f2bfae44a6

diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx
index 7cca4b4..023e5bd 100644
--- a/include/oox/dump/dumperbase.hxx
+++ b/include/oox/dump/dumperbase.hxx
@@ -1272,7 +1272,7 @@ private:
         OUString     maName;
         bool                mbStorage;
 
-        explicit     PreferredItem( const OUString rName, bool bStorage ) :
+        explicit     PreferredItem( const OUString& rName, bool bStorage ) :
                                 maName( rName ), mbStorage( bStorage ) {}
     };
     typedef ::std::vector< PreferredItem > PreferredItemVector;
commit 10dbb3b44f804c741bae6c4f467dd79d2d07d2be
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 15:12:03 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ia963e00be69d7a7b5b1d45f9827b05b69cd24a48

diff --git a/framework/inc/helper/vclstatusindicator.hxx b/framework/inc/helper/vclstatusindicator.hxx
index 650c8e6..ea3a38b 100644
--- a/framework/inc/helper/vclstatusindicator.hxx
+++ b/framework/inc/helper/vclstatusindicator.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_VCLSTATUSINDICATOR_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_VCLSTATUSINDICATOR_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <general.h>
@@ -38,8 +37,7 @@ namespace framework {
 
 // declaration
 
-class VCLStatusIndicator : private ThreadHelpBase, // must be the first real base class!
-                           public  ::cppu::WeakImplHelper1< css::task::XStatusIndicator >
+class VCLStatusIndicator : public  ::cppu::WeakImplHelper1< css::task::XStatusIndicator >
 {
 
     // member
diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx
index 099e02a..4bdb97a 100644
--- a/framework/source/helper/vclstatusindicator.cxx
+++ b/framework/source/helper/vclstatusindicator.cxx
@@ -19,8 +19,6 @@
 
 #include <helper/vclstatusindicator.hxx>
 
-#include <threadhelp/guard.hxx>
-
 #include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/svapp.hxx>
 
@@ -30,8 +28,7 @@ namespace framework {
 
 
 VCLStatusIndicator::VCLStatusIndicator(const css::uno::Reference< css::awt::XWindow >&               xParentWindow)
-    : ThreadHelpBase     (&Application::GetSolarMutex())
-    , m_xParentWindow    (xParentWindow                )
+    : m_xParentWindow    (xParentWindow                )
     , m_pStatusBar       (0                            )
     , m_nRange           (0                            )
     , m_nValue           (0                            )
@@ -52,108 +49,75 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText ,
                                               sal_Int32        nRange)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::awt::XWindow > xParentWindow = m_xParentWindow;
-    aReadLock.unlock();
-    // <- SAFE ----------------------------------
-
-    // SOLAR SAFE -> ----------------------------
-    {
-        SolarMutexGuard aSolarGuard;
+    SolarMutexGuard aSolarGuard;
 
-        Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
-        if (!m_pStatusBar)
-            m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER);
+    Window* pParentWindow = VCLUnoHelper::GetWindow(m_xParentWindow);
+    if (!m_pStatusBar)
+        m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER);
 
-        VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow);
+    VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow);
 
-        m_pStatusBar->Show();
-        m_pStatusBar->StartProgressMode(sText);
-        m_pStatusBar->SetProgressValue(0);
+    m_pStatusBar->Show();
+    m_pStatusBar->StartProgressMode(sText);
+    m_pStatusBar->SetProgressValue(0);
 
-        // force repaint!
-        pParentWindow->Show();
-        pParentWindow->Invalidate(INVALIDATE_CHILDREN);
-        pParentWindow->Flush();
-    }
-    // <- SOLAR SAFE ----------------------------
+    // force repaint!
+    pParentWindow->Show();
+    pParentWindow->Invalidate(INVALIDATE_CHILDREN);
+    pParentWindow->Flush();
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
     m_sText  = sText;
     m_nRange = nRange;
     m_nValue = 0;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
 }
 
 
 void SAL_CALL VCLStatusIndicator::reset()
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SOLAR SAFE -> ----------------------------
     SolarMutexGuard aSolarGuard;
     if (m_pStatusBar)
     {
         m_pStatusBar->SetProgressValue(0);
         m_pStatusBar->SetText(OUString());
     }
-    // <- SOLAR SAFE ----------------------------
 }
 
 
 void SAL_CALL VCLStatusIndicator::end()
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    SolarMutexGuard aSolarGuard;
+
     m_sText  = OUString();
     m_nRange = 0;
     m_nValue = 0;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
 
-    // SOLAR SAFE -> ----------------------------
+    if (m_pStatusBar)
     {
-        SolarMutexGuard aSolarGuard;
-        if (m_pStatusBar)
-        {
-            m_pStatusBar->EndProgressMode();
-            m_pStatusBar->Show(false);
-
-            delete m_pStatusBar;
-            m_pStatusBar = 0;
-        }
+        m_pStatusBar->EndProgressMode();
+        m_pStatusBar->Show(false);
+
+        delete m_pStatusBar;
+        m_pStatusBar = 0;
     }
-    // <- SOLAR SAFE ----------------------------
 }
 
 
 void SAL_CALL VCLStatusIndicator::setText(const OUString& sText)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    SolarMutexGuard aSolarGuard;
     m_sText = sText;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
-
-    // SOLAR SAFE -> ----------------------------
-    {
-        SolarMutexGuard aSolarGuard;
-        if (m_pStatusBar)
-            m_pStatusBar->SetText(sText);
-    }
-    // <- SOLAR SAFE ----------------------------
+    if (m_pStatusBar)
+        m_pStatusBar->SetText(sText);
 }
 
 
 void SAL_CALL VCLStatusIndicator::setValue(sal_Int32 nValue)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    SolarMutexGuard aSolarGuard;
 
     if (nValue <= m_nRange)
         m_nValue = nValue;
@@ -161,23 +125,15 @@ void SAL_CALL VCLStatusIndicator::setValue(sal_Int32 nValue)
         m_nValue = m_nRange;
 
     sal_Int32 nRange = m_nRange;
-              nValue = m_nValue;
-
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
+    nValue = m_nValue;
 
     // normalize value to fit the range of 0-100 %
     sal_uInt16 nPercent = sal::static_int_cast< sal_uInt16 >(
         ::std::min(
             ((nValue*100) / ::std::max(nRange,(sal_Int32)1)), (sal_Int32)100));
 
-    // SOLAR SAFE -> ----------------------------
-    {
-        SolarMutexGuard aSolarGuard;
-        if (m_pStatusBar)
-            m_pStatusBar->SetProgressValue(nPercent);
-    }
-    // <- SOLAR SAFE ----------------------------
+    if (m_pStatusBar)
+        m_pStatusBar->SetProgressValue(nPercent);
 }
 
 
commit f7d4bcfd4532a9b86d535f7b2a63532a240e758d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 15:07:28 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Iffc5e75c45502c770e9a3eee2a327df1e6843c9f

diff --git a/framework/inc/helper/uielementwrapperbase.hxx b/framework/inc/helper/uielementwrapperbase.hxx
index 649a21f..3fe1805 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 c59a1d8..c376635 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 75418fa..03698c1 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 5cca6dd..b7e22a8 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 a507977..6a2668e 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>
commit e6e3403f1fce1ad9285a4b41fea8b46cad6cf191
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 15:00:29 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I01c937881031c85a99aacbfbb3463203eb3d0b3e

diff --git a/framework/inc/helper/uiconfigelementwrapperbase.hxx b/framework/inc/helper/uiconfigelementwrapperbase.hxx
index 3f1a360..f44df00 100644
--- a/framework/inc/helper/uiconfigelementwrapperbase.hxx
+++ b/framework/inc/helper/uiconfigelementwrapperbase.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -36,6 +35,7 @@
 #include <com/sun/star/lang/XComponent.hpp>
 
 #include <rtl/ustring.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/implbase6.hxx>
 
@@ -50,7 +50,7 @@ typedef ::cppu::WeakImplHelper6<
            ::com::sun::star::util::XUpdatable,
            ::com::sun::star::ui::XUIConfigurationListener > UIConfigElementWrapperBase_BASE;
 
-class UIConfigElementWrapperBase : protected ThreadHelpBase                                      ,
+class UIConfigElementWrapperBase : private cppu::BaseMutex,
                                    public ::cppu::OBroadcastHelper                               ,
                                    public ::cppu::OPropertySetHelper                             ,
                                    public UIConfigElementWrapperBase_BASE
diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx
index 446ab6a..2bbccfe 100644
--- a/framework/source/helper/uiconfigelementwrapperbase.cxx
+++ b/framework/source/helper/uiconfigelementwrapperbase.cxx
@@ -20,7 +20,6 @@
 #include <helper/uiconfigelementwrapperbase.hxx>
 #include <general.h>
 #include <properties.h>
-#include <threadhelp/guard.hxx>
 #include <uielement/constitemcontainer.hxx>
 #include <uielement/rootitemcontainer.hxx>
 
@@ -60,8 +59,7 @@ namespace framework
 {
 
 UIConfigElementWrapperBase::UIConfigElementWrapperBase( 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_nType                     ( nType                                             )
     ,   m_bPersistent               ( true                                          )
@@ -70,7 +68,7 @@ UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType )
     ,   m_bConfigListening          ( false                                         )
     ,   m_bDisposed                 ( false                                         )
     ,   m_bNoClose                  ( false                                         )
-    ,   m_aListenerContainer        ( m_aLock.getShareableOslMutex()                    )
+    ,   m_aListenerContainer        ( m_aMutex )
 {
 }
 
@@ -109,14 +107,14 @@ void SAL_CALL UIConfigElementWrapperBase::removeEventListener( const ::com::sun:
 void SAL_CALL UIConfigElementWrapperBase::disposing( const EventObject& )
 throw( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
     m_xConfigSource.clear();
 }
 
 void SAL_CALL UIConfigElementWrapperBase::initialize( const Sequence< Any >& aArguments )
 throw ( Exception, RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bInitialized )
     {
@@ -452,7 +450,7 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigE
 }
 void SAL_CALL UIConfigElementWrapperBase::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexClearableGuard aLock;
 
 
     if ( xSettings.is() )
@@ -469,7 +467,7 @@ void SAL_CALL UIConfigElementWrapperBase::setSettings( const Reference< XIndexAc
             OUString aResourceURL( m_aResourceURL );
             Reference< XUIConfigurationManager > xUICfgMgr( m_xConfigSource );
 
-            aLock.unlock();
+            aLock.clear();
 
             try
             {
@@ -491,7 +489,7 @@ void UIConfigElementWrapperBase::impl_fillNewData()
 }
 Reference< XIndexAccess > SAL_CALL UIConfigElementWrapperBase::getSettings( sal_Bool bWriteable ) throw ( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
 
     if ( bWriteable )
@@ -502,20 +500,20 @@ Reference< XIndexAccess > SAL_CALL UIConfigElementWrapperBase::getSettings( sal_
 
 Reference< XFrame > SAL_CALL UIConfigElementWrapperBase::getFrame() throw (RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
     Reference< XFrame > xFrame( m_xWeakFrame );
     return xFrame;
 }
 
 OUString SAL_CALL UIConfigElementWrapperBase::getResourceURL() throw (RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
     return m_aResourceURL;
 }
 
 ::sal_Int16 SAL_CALL UIConfigElementWrapperBase::getType() throw (RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
     return m_nType;
 }
 
diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx
index 2da9975..5dcb184 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -98,7 +98,7 @@ void SAL_CALL MenuBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeExc
     com::sun::star::lang::EventObject aEvent( xThis );
     m_aListenerContainer.disposeAndClear( aEvent );
 
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     m_xMenuBarManager->dispose();
     m_xMenuBarManager.clear();
@@ -112,8 +112,7 @@ void SAL_CALL MenuBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeExc
 // XInitialization
 void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception )
 {
-
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -202,7 +201,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th
 // XUIElementSettings
 void SAL_CALL MenuBarWrapper::updateSettings() throw ( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -261,7 +260,7 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
 ::sal_Bool SAL_CALL MenuBarWrapper::hasElements()
 throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -277,7 +276,7 @@ throw ( container::NoSuchElementException,
         lang::WrappedTargetException,
         uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -298,7 +297,7 @@ throw ( container::NoSuchElementException,
 Sequence< OUString > SAL_CALL MenuBarWrapper::getElementNames()
 throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -322,7 +321,7 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
     const OUString& aName )
 throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx
index 3c1c89f..528bed4 100644
--- a/framework/source/uielement/statusbarwrapper.cxx
+++ b/framework/source/uielement/statusbarwrapper.cxx
@@ -71,7 +71,7 @@ void SAL_CALL StatusBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeE
     com::sun::star::lang::EventObject aEvent( xThis );
     m_aListenerContainer.disposeAndClear( aEvent );
 
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
     if ( !m_bDisposed )
     {
         if ( m_xStatusBarManager.is() )
@@ -90,7 +90,7 @@ void SAL_CALL StatusBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeE
 // XInitialization
 void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -139,7 +139,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments )
 // XUIElementSettings
 void SAL_CALL StatusBarWrapper::updateSettings() throw ( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -164,7 +164,7 @@ void SAL_CALL StatusBarWrapper::updateSettings() throw ( RuntimeException, std::
 
 Reference< XInterface > SAL_CALL StatusBarWrapper::getRealInterface() throw ( RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_xStatusBarManager.is() )
     {
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 076cfca..f9295f9 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -93,7 +93,7 @@ void SAL_CALL ToolBarWrapper::dispose() throw ( RuntimeException, std::exception
     Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
 
     {
-        Guard aLock( m_aLock );
+        SolarMutexGuard g;
         if ( m_bDisposed )
             return;
     }
@@ -101,7 +101,7 @@ void SAL_CALL ToolBarWrapper::dispose() throw ( RuntimeException, std::exception
     com::sun::star::lang::EventObject aEvent( xThis );
     m_aListenerContainer.disposeAndClear( aEvent );
 
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_xToolBarManager.is() )
         m_xToolBarManager->dispose();
@@ -115,7 +115,7 @@ void SAL_CALL ToolBarWrapper::dispose() throw ( RuntimeException, std::exception
 // XInitialization
 void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -201,7 +201,7 @@ void SAL_CALL ToolBarWrapper::disposing( const ::com::sun::star::lang::EventObje
 // XUpdatable
 void SAL_CALL ToolBarWrapper::update() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -214,7 +214,7 @@ void SAL_CALL ToolBarWrapper::update() throw (::com::sun::star::uno::RuntimeExce
 // XUIElementSettings
 void SAL_CALL ToolBarWrapper::updateSettings() throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_bDisposed )
         throw DisposedException();
@@ -253,7 +253,7 @@ void ToolBarWrapper::impl_fillNewData()
 // XUIElement interface
 Reference< XInterface > SAL_CALL ToolBarWrapper::getRealInterface(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_xToolBarManager.is() )
     {
@@ -274,7 +274,7 @@ void SAL_CALL ToolBarWrapper::functionExecute(
     const OUString& aCommand )
 throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aLock( m_aLock );
+    SolarMutexGuard g;
 
     if ( m_xToolBarManager.is() )
     {
@@ -286,13 +286,13 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
 
 void SAL_CALL ToolBarWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any&  aValue ) throw( com::sun::star::uno::Exception, std::exception )
 {
-    Guard aLock( m_aLock );
+    SolarMutexResettableGuard aLock;
     sal_Bool bNoClose( m_bNoClose );
-    aLock.unlock();
+    aLock.clear();
 
     UIConfigElementWrapperBase::setFastPropertyValue_NoBroadcast( nHandle, aValue );
 
-    aLock.lock();
+    aLock.reset();
 
     sal_Bool bNewNoClose( m_bNoClose );
     if ( m_xToolBarManager.is() && !m_bDisposed && ( bNewNoClose != bNoClose ))
commit 7cc2bb414c0ac42556cc5b11b8dbdad630927d78
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:52:35 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I58d52cfec21f2f93a6a17469bf31fc70d93c26a9

diff --git a/framework/inc/helper/titlebarupdate.hxx b/framework/inc/helper/titlebarupdate.hxx
index 75e0119..d45082d 100644
--- a/framework/inc/helper/titlebarupdate.hxx
+++ b/framework/inc/helper/titlebarupdate.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_TITLEBARUPDATE_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_TITLEBARUPDATE_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <general.h>
@@ -43,10 +42,7 @@ namespace framework{
     @devstatus      draft
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class TitleBarUpdate : // baseclasses (order necessary for right initialization!)
-                       private ThreadHelpBase
-                        // interfaces
-                     , public  ::cppu::WeakImplHelper3<
+class TitleBarUpdate : public  ::cppu::WeakImplHelper3<
                                    css::lang::XInitialization
                                  , css::frame::XTitleChangeListener // => XEventListener
                                  , css::frame::XFrameActionListener > // => XEventListener
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index 1805872..9450fd2 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -20,7 +20,6 @@
 #include <helper/titlebarupdate.hxx>
 
 #include <pattern/window.hxx>
-#include <threadhelp/guard.hxx>
 #include <macros/generic.hxx>
 #include <services.h>
 #include <properties.h>
@@ -54,8 +53,7 @@ static const ::sal_Int32 DEFAULT_ICON_ID =  0;
 
 
 TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext)
-    : ThreadHelpBase          (&Application::GetSolarMutex())
-    , m_xContext              (xContext                     )
+    : m_xContext              (xContext                     )
     , m_xFrame                (                             )
 {
 }
@@ -85,12 +83,11 @@ void SAL_CALL TitleBarUpdate::initialize(const css::uno::Sequence< css::uno::Any
                 static_cast< ::cppu::OWeakObject* >(this),
                 1);
 
-    // SYNCHRONIZED ->
-    Guard aWriteLock(m_aLock);
-    // hold the frame as weak reference(!) so it can die everytimes :-)
-    m_xFrame = xFrame;
-    aWriteLock.unlock();
-    // <- SYNCHRONIZED
+    {
+        SolarMutexGuard g;
+        // hold the frame as weak reference(!) so it can die everytimes :-)
+        m_xFrame = xFrame;
+    }
 
     // start listening
     xFrame->addFrameActionListener(this);
@@ -144,14 +141,8 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
 #if !defined(MACOSX)
     try
     {
-        // SYNCHRONIZED ->
-        Guard aReadLock(m_aLock);
-        css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
-        aReadLock.unlock();
-        // <- SYNCHRONIZED
-
         css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
-            css::frame::ModuleManager::create( xContext );
+            css::frame::ModuleManager::create( m_xContext );
 
         OUString sDesktopName;
         OUString aModuleId = xModuleManager->identify(xFrame);
@@ -215,16 +206,10 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
     if ( ! xFrame.is ())
         return sal_False;
 
-    // SYNCHRONIZED ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
-    aReadLock.unlock();
-    // <- SYNCHRONIZED
-
     try
     {
         css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
-            css::frame::ModuleManager::create( xContext );
+            css::frame::ModuleManager::create( m_xContext );
 
         rInfo.sID = xModuleManager->identify(xFrame);
         ::comphelper::SequenceAsHashMap lProps    = xModuleManager->getByName (rInfo.sID);
@@ -246,11 +231,11 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
 
 void TitleBarUpdate::impl_forceUpdate()
 {
-    // SYNCHRONIZED ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::frame::XFrame >              xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SYNCHRONIZED
+    css::uno::Reference< css::frame::XFrame > xFrame;
+    {
+        SolarMutexGuard g;
+        xFrame.set(m_xFrame.get(), css::uno::UNO_QUERY);
+    }
 
     // frame already gone ? We hold it weak only ...
     if ( ! xFrame.is())
commit 309eba8c5d1d1c86aeba1122d3ad62e68e3deee5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:50:04 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I4b902ac0f23d1b7e697dfec0ba31e6f396059a49

diff --git a/framework/inc/helper/tagwindowasmodified.hxx b/framework/inc/helper/tagwindowasmodified.hxx
index 8966a89..62298b4 100644
--- a/framework/inc/helper/tagwindowasmodified.hxx
+++ b/framework/inc/helper/tagwindowasmodified.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_TAGWINDOWASMODIFIED_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_TAGWINDOWASMODIFIED_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <general.h>
@@ -41,19 +40,13 @@ namespace framework{
     @descr          Used e.g. by our MAC port where such state is shown separately on some controls of the
                     title bar.
 
-    @base           ThreadHelpBase
-                        guarantee right initialized lock member during startup of instances of this class.
-
     @base           OWeakObject
                         implements ref counting for this class.
 
     @devstatus      draft
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class TagWindowAsModified :   // baseclasses (order necessary for right initialization!)
-                              private ThreadHelpBase,
-                              // interfaces
-                              public  ::cppu::WeakImplHelper3<
+class TagWindowAsModified :   public  ::cppu::WeakImplHelper3<
                                           css::lang::XInitialization,
                                           css::frame::XFrameActionListener, // => XEventListener
                                           css::util::XModifyListener >       // => XEventListener
diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx
index b0c68bc..6b08215 100644
--- a/framework/source/helper/tagwindowasmodified.cxx
+++ b/framework/source/helper/tagwindowasmodified.cxx
@@ -19,7 +19,6 @@
 
 #include <helper/tagwindowasmodified.hxx>
 #include <pattern/window.hxx>
-#include <threadhelp/guard.hxx>
 #include <macros/generic.hxx>
 #include <services.h>
 
@@ -43,7 +42,6 @@ namespace framework{
 
 
 TagWindowAsModified::TagWindowAsModified()
-    : ThreadHelpBase          (&Application::GetSolarMutex())
 {
 }
 
@@ -65,11 +63,10 @@ void SAL_CALL TagWindowAsModified::initialize(const css::uno::Sequence< css::uno
     if ( ! xFrame.is ())
         return;
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
-    m_xFrame = xFrame ;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
+    {
+        SolarMutexGuard g;
+        m_xFrame = xFrame ;
+    }
 
     xFrame->addFrameActionListener(this);
     impl_update (xFrame);
@@ -79,20 +76,19 @@ void SAL_CALL TagWindowAsModified::initialize(const css::uno::Sequence< css::uno
 void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& aEvent)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
-
-    css::uno::Reference< css::util::XModifiable > xModel (m_xModel.get (), css::uno::UNO_QUERY);
-    css::uno::Reference< css::awt::XWindow >      xWindow(m_xWindow.get(), css::uno::UNO_QUERY);
-    if (
-        ( ! xModel.is  ()       ) ||
-        ( ! xWindow.is ()       ) ||
-        (aEvent.Source != xModel)
-       )
-        return;
-
-    aReadLock.unlock();
-    // <- SAFE ----------------------------------
+    css::uno::Reference< css::util::XModifiable > xModel;
+    css::uno::Reference< css::awt::XWindow >      xWindow;
+    {
+        SolarMutexGuard g;
+        xModel.set(m_xModel.get (), css::uno::UNO_QUERY);
+        xWindow.set(m_xWindow.get(), css::uno::UNO_QUERY);
+        if (
+            ( ! xModel.is  ()       ) ||
+            ( ! xWindow.is ()       ) ||
+            (aEvent.Source != xModel)
+        )
+            return;
+    }
 
     ::sal_Bool bModified = xModel->isModified ();
 
@@ -125,18 +121,16 @@ void SAL_CALL TagWindowAsModified::frameAction(const css::frame::FrameActionEven
        )
         return;
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
-
-    css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
-    if (
-        ( ! xFrame.is ()        ) ||
-        (aEvent.Source != xFrame)
-       )
-        return;
-
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
+    css::uno::Reference< css::frame::XFrame > xFrame;
+    {
+        SolarMutexGuard g;
+        xFrame.set(m_xFrame.get(), css::uno::UNO_QUERY);
+        if (
+            ( ! xFrame.is ()        ) ||
+            (aEvent.Source != xFrame)
+        )
+            return;
+    }
 
     impl_update (xFrame);
 }
@@ -145,8 +139,7 @@ void SAL_CALL TagWindowAsModified::frameAction(const css::frame::FrameActionEven
 void SAL_CALL TagWindowAsModified::disposing(const css::lang::EventObject& aEvent)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    SolarMutexGuard g;
 
     css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
     if (
@@ -167,9 +160,6 @@ void SAL_CALL TagWindowAsModified::disposing(const css::lang::EventObject& aEven
         m_xModel = css::uno::Reference< css::frame::XModel >();
         return;
     }
-
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
 }
 
 
@@ -190,14 +180,13 @@ void TagWindowAsModified::impl_update (const css::uno::Reference< css::frame::XF
        )
         return;
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
-    // Note: frame was set as member outside ! we have to refresh connections
-    // regarding window and model only here.
-    m_xWindow = xWindow;
-    m_xModel  = xModel ;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
+    {
+        SolarMutexGuard g;
+        // Note: frame was set as member outside ! we have to refresh connections
+        // regarding window and model only here.
+        m_xWindow = xWindow;
+        m_xModel  = xModel ;
+    }
 
     css::uno::Reference< css::util::XModifyBroadcaster > xModifiable(xModel, css::uno::UNO_QUERY);
     if (xModifiable.is ())
commit 90cee97bc98ea82cbbc3985b1ae68cb19088a734
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:46:29 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Id9828f95673d1eaf87e6a1c22bf8f07e6861f2f4

diff --git a/framework/inc/helper/persistentwindowstate.hxx b/framework/inc/helper/persistentwindowstate.hxx
index f6926d8..ce4d354 100644
--- a/framework/inc/helper/persistentwindowstate.hxx
+++ b/framework/inc/helper/persistentwindowstate.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <general.h>
@@ -47,19 +46,13 @@ namespace framework{
                     we store its current position and size to the configuration. Every time a new component is
                     attached to a frame first time(!) we restore this information again.
 
-    @base           ThreadHelpBase
-                        guarantee right initialized lock member during startup of instances of this class.
-
     @base           OWeakObject
                         implements ref counting for this class.
 
     @devstatus      ready
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class PersistentWindowState :   // baseclasses (order necessary for right initialization!)
-                                private ThreadHelpBase,
-                                // interfaces
-                                public  ::cppu::WeakImplHelper2<
+class PersistentWindowState :   public  ::cppu::WeakImplHelper2<
                                            css::lang::XInitialization,
                                            css::frame::XFrameActionListener > // => XEventListener
 {
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index 0b37823..a542484 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -19,7 +19,6 @@
 
 #include <pattern/window.hxx>
 #include <helper/persistentwindowstate.hxx>
-#include <threadhelp/guard.hxx>
 #include <macros/generic.hxx>
 #include <services.h>
 
@@ -45,8 +44,7 @@ namespace framework{
 
 
 PersistentWindowState::PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext)
-    : ThreadHelpBase          (&Application::GetSolarMutex())
-    , m_xContext              (xContext                     )
+    : m_xContext              (xContext                     )
     , m_bWindowStateAlreadySet(sal_False                    )
 {
 }
@@ -76,12 +74,10 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
                 static_cast< ::cppu::OWeakObject* >(this),
                 1);
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
-    // hold the frame as weak reference(!) so it can die everytimes :-)
-    m_xFrame = xFrame;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
+    {
+        SolarMutexGuard g;
+        m_xFrame = xFrame;
+    }
 
     // start listening
     xFrame->addFrameActionListener(this);
@@ -91,13 +87,15 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
 void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEvent& aEvent)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::uno::XComponentContext >     xContext = m_xContext;
-    css::uno::Reference< css::frame::XFrame >              xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
-    sal_Bool                                               bRestoreWindowState = !m_bWindowStateAlreadySet;
-    aReadLock.unlock();
-    // <- SAFE ----------------------------------
+    css::uno::Reference< css::uno::XComponentContext >     xContext;
+    css::uno::Reference< css::frame::XFrame >              xFrame;
+    sal_Bool                                               bRestoreWindowState;
+    {
+        SolarMutexGuard g;
+        xContext = m_xContext;
+        xFrame.set(m_xFrame.get(), css::uno::UNO_QUERY);
+        bRestoreWindowState = !m_bWindowStateAlreadySet;
+    }
 
     // frame already gone ? We hold it weak only ...
     if (!xFrame.is())
@@ -121,11 +119,8 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
                 {
                     OUString sWindowState = PersistentWindowState::implst_getWindowStateFromConfig(xContext, sModuleName);
                     PersistentWindowState::implst_setWindowStateOnWindow(xWindow,sWindowState);
-                    // SAFE -> ----------------------------------
-                    Guard aWriteLock(m_aLock);
+                    SolarMutexGuard g;
                     m_bWindowStateAlreadySet = sal_True;
-                    aWriteLock.unlock();
-                    // <- SAFE ----------------------------------
                 }
             }
             break;
commit 503d893847fe8076340cf6a9de73a06892bc2660
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:44:10 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Id5ea9c7c7c3cb56d080daeb1e2e2c72483a37a4e

diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx
index a6b42e7..cff48a2 100644
--- a/framework/inc/helper/oframes.hxx
+++ b/framework/inc/helper/oframes.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_HELPER_OFRAMES_HXX
 
 #include <classes/framecontainer.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -55,8 +54,7 @@ namespace framework{
 
     @devstatus      deprecated
 *//*-*************************************************************************************************************/
-class OFrames   :   private ThreadHelpBase      ,   // Must be the first of baseclasses - Is necessary for right initialization of objects!
-                    public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XFrames >
+class OFrames   :   public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XFrames >
 {
     public:
 
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index d20904a..00652b6 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -19,8 +19,6 @@
 
 #include <helper/oframes.hxx>
 
-#include <threadhelp/guard.hxx>
-
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
 
@@ -42,10 +40,7 @@ using namespace ::std                           ;
 
 OFrames::OFrames( const   css::uno::Reference< XFrame >&              xOwner          ,
                             FrameContainer*                     pFrameContainer )
-        //  Init baseclasses first
-        :   ThreadHelpBase              ( &Application::GetSolarMutex() )
-        // Init member
-        ,   m_xOwner                    ( xOwner                        )
+        :   m_xOwner                    ( xOwner                        )
         ,   m_pFrameContainer           ( pFrameContainer               )
         ,   m_bRecursiveSearchProtection( sal_False                     )
 {
@@ -67,8 +62,7 @@ OFrames::~OFrames()
 //  XFrames
 void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
@@ -92,8 +86,7 @@ void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) thr
 //  XFrames
 void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
@@ -118,8 +111,7 @@ void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) thr
 //  XFrames
 Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearchFlags ) throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
@@ -224,8 +216,7 @@ Sequence< css::uno::Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int
 //  XIndexAccess
 sal_Int32 SAL_CALL OFrames::getCount() throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Set default return value.
     sal_Int32 nCount = 0;
@@ -250,8 +241,7 @@ Any SAL_CALL OFrames::getByIndex( sal_Int32 nIndex ) throw( IndexOutOfBoundsExce
                                                             WrappedTargetException      ,
                                                             RuntimeException, std::exception            )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
       sal_uInt32 nCount = m_pFrameContainer->getCount();
       if ( nIndex < 0 || ( sal::static_int_cast< sal_uInt32 >( nIndex ) >= nCount ))
@@ -287,8 +277,7 @@ Type SAL_CALL OFrames::getElementType() throw( RuntimeException, std::exception
 //  XElementAccess
 sal_Bool SAL_CALL OFrames::hasElements() throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Set default return value.
     sal_Bool bHasElements = sal_False;
commit 8030fe25724bd995a6902610614ba05ed6cfb643
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:42:27 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ie13cf612b2f9b15698a84d35d420b0b7c0009e1b

diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx
index 1b397f0..710a382 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_OCOMPONENTENUMERATION_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_OCOMPONENTENUMERATION_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -45,15 +44,13 @@ namespace framework{
                     XEventListener
                     XEnumeration
 
-    @base           ThreadHelpBase
-                    OWeakObject
+    @base           OWeakObject
 
     @devstatus      ready to use
     @threadsafe     yes
 *//*-*************************************************************************************************************/
 
-class OComponentEnumeration :   public ThreadHelpBase               ,
-                                public ::cppu::WeakImplHelper2< ::com::sun::star::container::XEnumeration,::com::sun::star::lang::XEventListener >
+class OComponentEnumeration :   public ::cppu::WeakImplHelper2< ::com::sun::star::container::XEnumeration,::com::sun::star::lang::XEventListener >
 {
 
     //  public methods
diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx
index e7e1eaa..2f3057c 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -19,8 +19,6 @@
 
 #include <helper/ocomponentenumeration.hxx>
 
-#include <threadhelp/guard.hxx>
-
 #include <vcl/svapp.hxx>
 
 namespace framework{
@@ -36,15 +34,7 @@ using namespace ::rtl                           ;
 //  constructor
 
 OComponentEnumeration::OComponentEnumeration( const Sequence< css::uno::Reference< XComponent > >& seqComponents )
-        //  Init baseclasses first
-        //  Attention:
-        //      Don't change order of initialization!
-        //      ThreadHelpBase is a struct with a mutex as member. We can't use a mutex as member, while
-        //      we must garant right initialization and a valid value of this! First initialize
-        //      baseclasses and then members. And we need the mutex for other baseclasses !!!
-        :   ThreadHelpBase  ( &Application::GetSolarMutex() )
-        // Init member
-        ,   m_nPosition     ( 0                             )   // 0 is the first position for a valid list and the right value for an invalid list to!
+        :   m_nPosition     ( 0                             )   // 0 is the first position for a valid list and the right value for an invalid list to!
         ,   m_seqComponents ( seqComponents                 )
 {
     // Safe impossible states
@@ -65,8 +55,7 @@ OComponentEnumeration::~OComponentEnumeration()
 //  XEventListener
 void SAL_CALL OComponentEnumeration::disposing( const EventObject& aEvent ) throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Safe impossible cases
     // This method is not specified for all incoming parameters.
@@ -81,8 +70,7 @@ void SAL_CALL OComponentEnumeration::disposing( const EventObject& aEvent ) thro
 //  XEnumeration
 sal_Bool SAL_CALL OComponentEnumeration::hasMoreElements() throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // First position in a valid list is 0.
     // => The last one is getLength() - 1!
@@ -98,8 +86,7 @@ Any SAL_CALL OComponentEnumeration::nextElement() throw(    NoSuchElementExcepti
                                                              WrappedTargetException ,
                                                             RuntimeException, std::exception        )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // If we have no elements or end of enumeration is arrived ...
     if ( hasMoreElements() == sal_False )
commit 4eb2c58093123262ee2366898c7ab779db985948
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:40:51 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ib63b12595f4f9a43c4742d8cf8cfea4713ebdf14

diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx
index 5e4cb9a..495d719 100644
--- a/framework/inc/helper/ocomponentaccess.hxx
+++ b/framework/inc/helper/ocomponentaccess.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_OCOMPONENTACCESS_HXX
 #define INCLUDED_FRAMEWORK_INC_HELPER_OCOMPONENTACCESS_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -50,14 +49,12 @@ namespace framework{
                     XEnumerationAccess
                     XElementAccess
 
-    @base           ThreadHelpBase
-                    OWeakObject
+    @base           OWeakObject
 
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class OComponentAccess  :   private ThreadHelpBase                      ,   // Must be the first of baseclasses - Is necessary for right initialization of objects!
-                            public ::cppu::WeakImplHelper1< ::com::sun::star::container::XEnumerationAccess >
+class OComponentAccess  :   public ::cppu::WeakImplHelper1< ::com::sun::star::container::XEnumerationAccess >
 {
 
     //  public methods
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx
index 65a150f..f867998 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -20,8 +20,6 @@
 #include <helper/ocomponentaccess.hxx>
 #include <helper/ocomponentenumeration.hxx>
 
-#include <threadhelp/guard.hxx>
-
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
 
 #include <vcl/svapp.hxx>
@@ -40,10 +38,7 @@ using namespace ::rtl                           ;
 //  constructor
 
 OComponentAccess::OComponentAccess( const css::uno::Reference< XDesktop >& xOwner )
-        //  Init baseclasses first
-        :   ThreadHelpBase  ( &Application::GetSolarMutex() )
-        // Init member
-        ,   m_xOwner        ( xOwner                        )
+        :   m_xOwner        ( xOwner                        )
 {
     // Safe impossible cases
     SAL_WARN_IF( !impldbg_checkParameter_OComponentAccessCtor( xOwner ), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" );
@@ -60,8 +55,7 @@ OComponentAccess::~OComponentAccess()
 //  XEnumerationAccess
 css::uno::Reference< XEnumeration > SAL_CALL OComponentAccess::createEnumeration() throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Set default return value, if method failed.
     // If no desktop exist and there is no task container - return an empty enumeration!
@@ -98,8 +92,7 @@ Type SAL_CALL OComponentAccess::getElementType() throw( RuntimeException, std::e
 //  XElementAccess
 sal_Bool SAL_CALL OComponentAccess::hasElements() throw( RuntimeException, std::exception )
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Set default return value, if method failed.
     sal_Bool bReturn = sal_False;
commit 82f79abae5cf92940d8c2d642792da8b44e155d1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:39:22 2014 +0100

    Use SolarMutexGuard directly
    
    ...and access safe members directly
    
    Change-Id: I46fa7683922b0604118f6da219f44204767f4618

diff --git a/framework/inc/helper/dockingareadefaultacceptor.hxx b/framework/inc/helper/dockingareadefaultacceptor.hxx
index 8c302e6..7d2f7c0 100644
--- a/framework/inc/helper/dockingareadefaultacceptor.hxx
+++ b/framework/inc/helper/dockingareadefaultacceptor.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_HELPER_DOCKINGAREADEFAULTACCEPTOR_HXX
 
 #include <classes/framecontainer.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -37,8 +36,7 @@ namespace framework{
 
 
 
-class DockingAreaDefaultAcceptor    :   private ThreadHelpBase                                      ,
-                                        public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XDockingAreaAcceptor >
+class DockingAreaDefaultAcceptor    :   public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XDockingAreaAcceptor >
 {
     public:
 
diff --git a/framework/source/helper/dockingareadefaultacceptor.cxx b/framework/source/helper/dockingareadefaultacceptor.cxx
index f0746ee..a1c9acb 100644
--- a/framework/source/helper/dockingareadefaultacceptor.cxx
+++ b/framework/source/helper/dockingareadefaultacceptor.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <helper/dockingareadefaultacceptor.hxx>
-#include <threadhelp/guard.hxx>
 
 #include <com/sun/star/awt/XDevice.hpp>
 #include <com/sun/star/awt/PosSize.hpp>
@@ -39,10 +38,7 @@ using namespace ::osl                           ;
 //  constructor
 
 DockingAreaDefaultAcceptor::DockingAreaDefaultAcceptor( const   css::uno::Reference< XFrame >&      xOwner  )
-        //  Init baseclasses first
-        :   ThreadHelpBase  ( &Application::GetSolarMutex() )
-        // Init member
-        ,   m_xOwner        ( xOwner    )
+        :   m_xOwner        ( xOwner    )
 {
 }
 
@@ -57,11 +53,11 @@ DockingAreaDefaultAcceptor::~DockingAreaDefaultAcceptor()
 //  XDockingAreaAcceptor
 css::uno::Reference< css::awt::XWindow > SAL_CALL DockingAreaDefaultAcceptor::getContainerWindow() throw (css::uno::RuntimeException, std::exception)
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Try to "lock" the frame for access to taskscontainer.
-    css::uno::Reference< XFrame > xFrame( m_xOwner.get(), UNO_QUERY );
+    css::uno::Reference< XFrame > xFrame( m_xOwner );
+    //TODO: check xFrame for null?
     css::uno::Reference< css::awt::XWindow > xContainerWindow( xFrame->getContainerWindow() );
 
     return xContainerWindow;
@@ -69,12 +65,8 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL DockingAreaDefaultAcceptor::ge
 
 sal_Bool SAL_CALL DockingAreaDefaultAcceptor::requestDockingAreaSpace( const css::awt::Rectangle& RequestedSpace ) throw (css::uno::RuntimeException, std::exception)
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
-
     // Try to "lock" the frame for access to taskscontainer.
-    css::uno::Reference< XFrame > xFrame( m_xOwner.get(), UNO_QUERY );
-    aGuard.unlock();
+    css::uno::Reference< XFrame > xFrame( m_xOwner );
 
     if ( xFrame.is() )
     {
@@ -106,11 +98,10 @@ sal_Bool SAL_CALL DockingAreaDefaultAcceptor::requestDockingAreaSpace( const css
 
 void SAL_CALL DockingAreaDefaultAcceptor::setDockingAreaSpace( const css::awt::Rectangle& BorderSpace ) throw (css::uno::RuntimeException, std::exception)
 {
-    // Ready for multithreading
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     // Try to "lock" the frame for access to taskscontainer.
-    css::uno::Reference< XFrame > xFrame( m_xOwner.get(), UNO_QUERY );
+    css::uno::Reference< XFrame > xFrame( m_xOwner );
     if ( xFrame.is() )
     {
         css::uno::Reference< css::awt::XWindow > xContainerWindow( xFrame->getContainerWindow() );
commit e28207718cf83fa93bb1010a047fcb526d504e95
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:34:20 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I0438d85b0c51010eff9e8d53ed8acada98563a20

diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx
index f57ce62..c1c3b16 100644
--- a/framework/inc/xml/toolboxdocumenthandler.hxx
+++ b/framework/inc/xml/toolboxdocumenthandler.hxx
@@ -25,7 +25,6 @@
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <rtl/ustring.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <stdtypes.h>
@@ -36,7 +35,7 @@ namespace framework{
 
 // Hash code function for using in all hash maps of follow implementation.
 
-class FWE_DLLPUBLIC OReadToolBoxDocumentHandler : private ThreadHelpBase,   // Struct for right initalization of lock member! Must be first of baseclasses.
+class FWE_DLLPUBLIC OReadToolBoxDocumentHandler :
                                     public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
 {
     public:
@@ -152,7 +151,7 @@ class FWE_DLLPUBLIC OReadToolBoxDocumentHandler : private ThreadHelpBase,   // S
 };
 
 
-class FWE_DLLPUBLIC OWriteToolBoxDocumentHandler : private ThreadHelpBase   // Struct for right initalization of lock member! Must be first of baseclasses.
+class FWE_DLLPUBLIC OWriteToolBoxDocumentHandler
 {
     public:
             OWriteToolBoxDocumentHandler(
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index fcef408..854cb4b 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 
-#include <threadhelp/guard.hxx>
 #include <xml/toolboxdocumenthandler.hxx>
 #include <xml/toolboxconfigurationdefines.hxx>
 
@@ -139,7 +138,6 @@ ToolBarEntryProperty ToolBoxEntries[OReadToolBoxDocumentHandler::TB_XML_ENTRY_CO
 };
 
 OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XIndexContainer >& rItemContainer ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_rItemContainer( rItemContainer ),
     m_aType( ITEM_DESCRIPTOR_TYPE ),
     m_aLabel( ITEM_DESCRIPTOR_LABEL ),
@@ -204,7 +202,7 @@ throw ( SAXException, RuntimeException, std::exception )
 void SAL_CALL OReadToolBoxDocumentHandler::endDocument(void)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if (( m_bToolBarStartFound && !m_bToolBarEndFound ) ||
         ( !m_bToolBarStartFound && m_bToolBarEndFound )     )
@@ -219,7 +217,7 @@ void SAL_CALL OReadToolBoxDocumentHandler::startElement(
     const OUString& aName, const Reference< XAttributeList > &xAttribs )
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     ToolBoxHashMap::const_iterator pToolBoxEntry = m_aToolBoxMap.find( aName ) ;
     if ( pToolBoxEntry != m_aToolBoxMap.end() )
@@ -537,7 +535,7 @@ throw(  SAXException, RuntimeException, std::exception )
 void SAL_CALL OReadToolBoxDocumentHandler::endElement(const OUString& aName)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     ToolBoxHashMap::const_iterator pToolBoxEntry = m_aToolBoxMap.find( aName ) ;
     if ( pToolBoxEntry != m_aToolBoxMap.end() )
@@ -635,14 +633,14 @@ void SAL_CALL OReadToolBoxDocumentHandler::setDocumentLocator(
     const Reference< XLocator > &xLocator)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     m_xLocator = xLocator;
 }
 
 OUString OReadToolBoxDocumentHandler::getErrorLineString()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     char buffer[32];
 
@@ -663,7 +661,6 @@ OUString OReadToolBoxDocumentHandler::getErrorLineString()
 OWriteToolBoxDocumentHandler::OWriteToolBoxDocumentHandler(
     const Reference< XIndexAccess >& rItemAccess,
     Reference< XDocumentHandler >& rWriteDocumentHandler ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_xWriteDocumentHandler( rWriteDocumentHandler ),
     m_rItemAccess( rItemAccess )
 {
@@ -681,7 +678,7 @@ OWriteToolBoxDocumentHandler::~OWriteToolBoxDocumentHandler()
 void OWriteToolBoxDocumentHandler::WriteToolBoxDocument() throw
 ( SAXException, RuntimeException )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     m_xWriteDocumentHandler->startDocument();
 
commit 3b45c88a404683bbad8dfbbbadffa2494b8476c0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:30:46 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: I5408403318691f9b83c5b69658a37916fa23ea69

diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx
index b9cd350..0168abd 100644
--- a/framework/inc/xml/statusbardocumenthandler.hxx
+++ b/framework/inc/xml/statusbardocumenthandler.hxx
@@ -24,7 +24,6 @@
 
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <rtl/ustring.hxx>
 #include <cppuhelper/implbase1.hxx>
 
@@ -37,7 +36,7 @@ namespace framework{
 
 // Hash code function for using in all hash maps of follow implementation.
 
-class FWE_DLLPUBLIC OReadStatusBarDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
+class FWE_DLLPUBLIC OReadStatusBarDocumentHandler :
                                         public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
 {
     public:
@@ -126,7 +125,7 @@ class FWE_DLLPUBLIC OReadStatusBarDocumentHandler : private ThreadHelpBase, // S
         ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >            m_xLocator;
 };
 
-class FWE_DLLPUBLIC OWriteStatusBarDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
+class FWE_DLLPUBLIC OWriteStatusBarDocumentHandler
 {
     public:
         OWriteStatusBarDocumentHandler(
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index a0f45f7..6837dbb 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 
-#include <threadhelp/guard.hxx>
 #include <xml/statusbardocumenthandler.hxx>
 
 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
@@ -147,7 +146,6 @@ StatusBarEntryProperty StatusBarEntries[OReadStatusBarDocumentHandler::SB_XML_EN
 
 OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
     const Reference< XIndexContainer >& rStatusBarItems ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_aStatusBarItems( rStatusBarItems )
 {
     OUString aNamespaceStatusBar( XMLNS_STATUSBAR );
@@ -191,7 +189,7 @@ throw ( SAXException, RuntimeException, std::exception )
 void SAL_CALL OReadStatusBarDocumentHandler::endDocument(void)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if (( m_bStatusBarStartFound && !m_bStatusBarEndFound ) ||
         ( !m_bStatusBarStartFound && m_bStatusBarEndFound )     )
@@ -206,7 +204,7 @@ void SAL_CALL OReadStatusBarDocumentHandler::startElement(
     const OUString& aName, const Reference< XAttributeList > &xAttribs )
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ;
     if ( pStatusBarEntry != m_aStatusBarMap.end() )
@@ -405,7 +403,7 @@ throw(  SAXException, RuntimeException, std::exception )
 void SAL_CALL OReadStatusBarDocumentHandler::endElement(const OUString& aName)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ;
     if ( pStatusBarEntry != m_aStatusBarMap.end() )
@@ -464,14 +462,14 @@ void SAL_CALL OReadStatusBarDocumentHandler::setDocumentLocator(
     const Reference< XLocator > &xLocator)
 throw(  SAXException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     m_xLocator = xLocator;
 }
 
 OUString OReadStatusBarDocumentHandler::getErrorLineString()
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     char buffer[32];
 
@@ -492,7 +490,6 @@ OUString OReadStatusBarDocumentHandler::getErrorLineString()
 OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler(
     const Reference< XIndexAccess >& aStatusBarItems,
     const Reference< XDocumentHandler >& rWriteDocumentHandler ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
     m_aStatusBarItems( aStatusBarItems ),
     m_xWriteDocumentHandler( rWriteDocumentHandler )
 {
@@ -510,7 +507,7 @@ OWriteStatusBarDocumentHandler::~OWriteStatusBarDocumentHandler()
 void OWriteStatusBarDocumentHandler::WriteStatusBarDocument() throw
 ( SAXException, RuntimeException )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     m_xWriteDocumentHandler->startDocument();
 
commit 5e5c6656c9d99e13f7877a0e30f8fee29981e53c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:26:37 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: I367ffa9343a0227eab9726c636d7e8e622219bf4

diff --git a/framework/inc/xml/saxnamespacefilter.hxx b/framework/inc/xml/saxnamespacefilter.hxx
index a7b7799..660a937 100644
--- a/framework/inc/xml/saxnamespacefilter.hxx
+++ b/framework/inc/xml/saxnamespacefilter.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_XML_SAXNAMESPACEFILTER_HXX
 
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <threadhelp/threadhelpbase.hxx>
 #include <xml/xmlnamespaces.hxx>
 #include <rtl/ustring.hxx>
 #include <vcl/menu.hxx>
@@ -33,7 +32,7 @@
 namespace framework
 {
 
-class FWE_DLLPUBLIC SaxNamespaceFilter : public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+class FWE_DLLPUBLIC SaxNamespaceFilter :
                            public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
 {
     public:
diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx
index 4cc22c50..cff7cf7 100644
--- a/framework/source/fwe/xml/saxnamespacefilter.cxx
+++ b/framework/source/fwe/xml/saxnamespacefilter.cxx
@@ -38,7 +38,6 @@ namespace framework{
 
 
 SaxNamespaceFilter::SaxNamespaceFilter( Reference< XDocumentHandler >& rSax1DocumentHandler ) :
-    ThreadHelpBase( &Application::GetSolarMutex() ),
      m_xLocator( 0 ),
      xDocumentHandler( rSax1DocumentHandler ),
      m_nDepth( 0 ),
commit 36a5ea2a9c66f3cd6045e9f11b6e1b5f58858155
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:24:50 2014 +0100

    Use SolarMutexGuard directly
    
    Change-Id: Ia80e709bea172722aa07ee75ebeeef4ac8f5281a

diff --git a/framework/inc/helper/propertysetcontainer.hxx b/framework/inc/helper/propertysetcontainer.hxx
index 9675be8..5f3051c 100644
--- a/framework/inc/helper/propertysetcontainer.hxx
+++ b/framework/inc/helper/propertysetcontainer.hxx
@@ -27,14 +27,12 @@
 #include <cppuhelper/weak.hxx>
 #include <com/sun/star/container/XIndexContainer.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <threadhelp/threadhelpbase.hxx>
 #include <framework/fwedllapi.h>
 
 namespace framework
 {
 
 class FWE_DLLPUBLIC PropertySetContainer : public com::sun::star::container::XIndexContainer    ,
-                             public ThreadHelpBase                              ,   // Struct for right initalization of mutex member! Must be first of baseclasses.
                              public ::cppu::OWeakObject
 {
     public:
diff --git a/framework/source/fwe/classes/rootactiontriggercontainer.cxx b/framework/source/fwe/classes/rootactiontriggercontainer.cxx
index 6670e76..1cbc631 100644
--- a/framework/source/fwe/classes/rootactiontriggercontainer.cxx
+++ b/framework/source/fwe/classes/rootactiontriggercontainer.cxx
@@ -126,7 +126,7 @@ throw ( RuntimeException, std::exception )
 void SAL_CALL RootActionTriggerContainer::insertByIndex( sal_Int32 Index, const Any& Element )
 throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bContainerCreated )
         FillContainer();
@@ -139,7 +139,7 @@ throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetExcept
 void SAL_CALL RootActionTriggerContainer::removeByIndex( sal_Int32 Index )
 throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bContainerCreated )
         FillContainer();
@@ -153,7 +153,7 @@ throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std
 void SAL_CALL RootActionTriggerContainer::replaceByIndex( sal_Int32 Index, const Any& Element )
 throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bContainerCreated )
         FillContainer();
@@ -167,7 +167,7 @@ throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetExcept
 sal_Int32 SAL_CALL RootActionTriggerContainer::getCount()
 throw ( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bContainerCreated )
     {
@@ -188,7 +188,7 @@ throw ( RuntimeException, std::exception )
 Any SAL_CALL RootActionTriggerContainer::getByIndex( sal_Int32 Index )
 throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( !m_bContainerCreated )
         FillContainer();
diff --git a/framework/source/fwe/helper/propertysetcontainer.cxx b/framework/source/fwe/helper/propertysetcontainer.cxx
index 347f83c..2eea34c 100644
--- a/framework/source/fwe/helper/propertysetcontainer.cxx
+++ b/framework/source/fwe/helper/propertysetcontainer.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <helper/propertysetcontainer.hxx>
-#include <threadhelp/guard.hxx>
 
 #include <vcl/svapp.hxx>
 
@@ -34,8 +33,7 @@ namespace framework
 {
 
 PropertySetContainer::PropertySetContainer()
-        :   ThreadHelpBase( &Application::GetSolarMutex() )
-        ,   OWeakObject()
+        :   OWeakObject()
 
 {
 }
@@ -79,7 +77,7 @@ throw ( RuntimeException, std::exception )
 void SAL_CALL PropertySetContainer::insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
     throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     sal_Int32 nSize = m_aPropertySetVector.size();
 
@@ -112,7 +110,7 @@ void SAL_CALL PropertySetContainer::insertByIndex( sal_Int32 Index, const ::com:
 void SAL_CALL PropertySetContainer::removeByIndex( sal_Int32 nIndex )
     throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( (sal_Int32)m_aPropertySetVector.size() > nIndex )
     {
@@ -149,7 +147,7 @@ void SAL_CALL PropertySetContainer::replaceByIndex( sal_Int32 Index, const ::com
 sal_Int32 SAL_CALL PropertySetContainer::getCount()
     throw ( RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return m_aPropertySetVector.size();
 }
@@ -157,7 +155,7 @@ sal_Int32 SAL_CALL PropertySetContainer::getCount()
 Any SAL_CALL PropertySetContainer::getByIndex( sal_Int32 Index )
     throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     if ( (sal_Int32)m_aPropertySetVector.size() > Index )
     {
@@ -174,7 +172,7 @@ Any SAL_CALL PropertySetContainer::getByIndex( sal_Int32 Index )
 sal_Bool SAL_CALL PropertySetContainer::hasElements()
     throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
-    Guard aGuard( m_aLock );
+    SolarMutexGuard g;
 
     return !( m_aPropertySetVector.empty() );
 }
commit 8b28069c8f31ead729dac462e477e19b738690a4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:21:34 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: Ib530dec8e812d8ecccba47c70e3d1e9640083378

diff --git a/framework/inc/classes/imagewrapper.hxx b/framework/inc/classes/imagewrapper.hxx
index 36b9044..f982f1e 100644
--- a/framework/inc/classes/imagewrapper.hxx
+++ b/framework/inc/classes/imagewrapper.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_IMAGEWRAPPER_HXX
 #define INCLUDED_FRAMEWORK_INC_CLASSES_IMAGEWRAPPER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <com/sun/star/awt/XBitmap.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
@@ -31,7 +30,7 @@
 namespace framework
 {
 
-class FWE_DLLPUBLIC ImageWrapper : public ThreadHelpBase                            ,   // Struct for right initalization of mutex member! Must be first of baseclasses.
+class FWE_DLLPUBLIC ImageWrapper :
                      public ::cppu::WeakImplHelper2< ::com::sun::star::awt::XBitmap,
                                                     ::com::sun::star::lang::XUnoTunnel >
 {
diff --git a/framework/source/fwe/classes/imagewrapper.cxx b/framework/source/fwe/classes/imagewrapper.cxx
index 77a1988..f51751d6 100644
--- a/framework/source/fwe/classes/imagewrapper.cxx
+++ b/framework/source/fwe/classes/imagewrapper.cxx
@@ -41,8 +41,7 @@ static Sequence< sal_Int8 > impl_getStaticIdentifier()
 }
 
 
-ImageWrapper::ImageWrapper( const Image& aImage ) : ThreadHelpBase( &Application::GetSolarMutex() )
-                                                    ,   m_aImage( aImage )
+ImageWrapper::ImageWrapper( const Image& aImage ) : m_aImage( aImage )
 {
 }
 
commit 0bed494bfcde05bf1f5f04f58610a0d185b0b660
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 18 14:19:48 2014 +0100

    Use cppu::BaseMutex instead of framework::ThreadHelpBase
    
    Change-Id: I77b88bf1bed18c6a863f9e6d753035c90ef64c07

diff --git a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx
index de90232..41a2921 100644
--- a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx
+++ b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_ACTIONTRIGGERSEPARATORPROPERTYSET_HXX
 #define INCLUDED_FRAMEWORK_INC_CLASSES_ACTIONTRIGGERSEPARATORPROPERTYSET_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/weak.hxx>
 #include <osl/mutex.hxx>
@@ -37,7 +37,7 @@
 namespace framework
 {
 
-class ActionTriggerSeparatorPropertySet :   public ThreadHelpBase                       ,   // Struct for right initalization of mutex member! Must be first of baseclasses.
+class ActionTriggerSeparatorPropertySet :   private cppu::BaseMutex,
                                             public ::com::sun::star::lang::XServiceInfo ,
                                             public ::com::sun::star::lang::XTypeProvider,
                                             public ::cppu::OBroadcastHelper             ,
diff --git a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
index bca4cdd..6f413c0 100644
--- a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
+++ b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
@@ -19,6 +19,7 @@
 
 
 #include <classes/actiontriggerseparatorpropertyset.hxx>
+#include <threadhelp/lockhelper.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <cppuhelper/proptypehlp.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -47,8 +48,7 @@ namespace framework
 {
 
 ActionTriggerSeparatorPropertySet::ActionTriggerSeparatorPropertySet()
-        :   ThreadHelpBase          ( &Application::GetSolarMutex()                     )
-        ,   OBroadcastHelper        ( m_aLock.getShareableOslMutex()                    )
+        :   OBroadcastHelper        ( m_aMutex )
         ,   OPropertySetHelper      ( *(static_cast< OBroadcastHelper * >(this))        )
         ,   OWeakObject             (                                                   )
         ,   m_nSeparatorType( 0 )
commit bf1b78c2d9e7c624ac12a5b09cef48b15b8b1d36
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 18 11:22:50 2014 +0200

    Add simple document selector to TiledLibreOffice
    
    Make it easier to handle several test docs. Until now you had to
    change the hardcoded document in the Xcode project and in the lo.mm
    source file and re-build. Now it is enough to upload a new test doc to
    the device using iTunes. If no test docs are present, use the good old
    bundled test1.odt.
    
    Change-Id: I3cbb9f74c17332ffc6ac90dd1e226fac005c3387

diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj/project.pbxproj b/ios/experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj/project.pbxproj
index 0ffd267..e2153dd 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj/project.pbxproj
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		BE55B06D18D87CC600950228 /* DocumentTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BE55B06C18D87CC600950228 /* DocumentTableViewController.m */; };
 		BE82BD7618218E2E00A447B5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE82BD7518218E2E00A447B5 /* Foundation.framework */; };
 		BE82BD7818218E2E00A447B5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE82BD7718218E2E00A447B5 /* CoreGraphics.framework */; };
 		BE82BD7A18218E2E00A447B5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE82BD7918218E2E00A447B5 /* UIKit.framework */; };
@@ -166,6 +167,8 @@
 		BE35B5A2188FFA88001B7439 /* unourl.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = unourl.cxx; path = ../../../cppuhelper/source/unourl.cxx; sourceTree = "<group>"; };
 		BE35B5A3188FFA88001B7439 /* weak.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = weak.cxx; path = ../../../cppuhelper/source/weak.cxx; sourceTree = "<group>"; };
 		BE35B5A71890520E001B7439 /* objface.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = objface.cxx; path = ../../../sfx2/source/control/objface.cxx; sourceTree = "<group>"; };
+		BE55B06B18D87CC600950228 /* DocumentTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTableViewController.h; sourceTree = "<group>"; };
+		BE55B06C18D87CC600950228 /* DocumentTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocumentTableViewController.m; sourceTree = "<group>"; };
 		BE7C277218D1DDF600C4908C /* acmplwrd.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = acmplwrd.cxx; path = ../../../sw/source/core/doc/acmplwrd.cxx; sourceTree = "<group>"; };
 		BE7C277318D1DDF600C4908C /* dbgoutsw.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = dbgoutsw.cxx; path = ../../../sw/source/core/doc/dbgoutsw.cxx; sourceTree = "<group>"; };
 		BE7C277418D1DDF600C4908C /* doc.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = doc.cxx; path = ../../../sw/source/core/doc/doc.cxx; sourceTree = "<group>"; };
@@ -802,6 +805,8 @@
 				BECAB371186054DE00F814F9 /* lo.mm */,
 				BE82BD8418218E2E00A447B5 /* AppDelegate.h */,
 				BE82BD8518218E2E00A447B5 /* AppDelegate.m */,
+				BE55B06B18D87CC600950228 /* DocumentTableViewController.h */,
+				BE55B06C18D87CC600950228 /* DocumentTableViewController.m */,
 				BE82BDAA182190E400A447B5 /* TiledView.h */,
 				BE82BDAB182190E400A447B5 /* TiledView.m */,
 				BE82BDAD1821A1D000A447B5 /* View.h */,
@@ -1236,6 +1241,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				BECAB372186054DE00F814F9 /* lo.mm in Sources */,
+				BE55B06D18D87CC600950228 /* DocumentTableViewController.m in Sources */,
 				BE82BDAF1821A1D000A447B5 /* View.m in Sources */,
 				BE82BDAC182190E400A447B5 /* TiledView.m in Sources */,
 				BE82BD8C18218E2E00A447B5 /* ViewController.m in Sources */,
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.h b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.h
index e128714..3d27a8d 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.h
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.h
@@ -12,7 +12,7 @@
 
 @property (strong, nonatomic) UIWindow *window;
 
-- (void)threadMainMethod: (id) argument;
+- (void)startDisplaying:(NSString*)documentPath;
 
 @end
 
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
index 9b9e525..10e5d70 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
@@ -9,10 +9,18 @@
 #include <touch/touch.h>
 
 #import "AppDelegate.h"
+#import "DocumentTableViewController.h"
 #import "View.h"
 #import "ViewController.h"
 #import "lo.h"
 
+ at interface AppDelegate ()
+
+- (void)showDocumentList:(NSArray*)documents inFolder:(NSString*)folder;
+- (void)threadMainMethod:(NSString *)documentPath;
+
+ at end
+
 @implementation AppDelegate
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
@@ -21,26 +29,55 @@
     self.window.backgroundColor = [UIColor whiteColor];
     [self.window makeKeyAndVisible];
 
-    ViewController *vc = [[ViewController alloc] init];
-    self.window.rootViewController = vc;
+    NSFileManager *fileManager = [NSFileManager defaultManager];
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+    NSString *documentsDirectory = [paths objectAtIndex:0];
 
-    [[[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:nil] start];
+    NSDirectoryEnumerator *dirEnumerator = [fileManager enumeratorAtPath:documentsDirectory];
+    int nDocs = 0;
+    NSString *document;
+    NSMutableArray *documents = [[NSMutableArray alloc] init];
+    NSString *test1 = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"test1.odt"];
+    [documents addObject:test1];
 
-    vc.view = [[View alloc] initWithFrame:[self.window frame]];
+    while ((document = [dirEnumerator nextObject])) {
+        nDocs++;
+        [documents addObject:[documentsDirectory stringByAppendingPathComponent:document]];
+    }
+
+    if (nDocs == 0) {
+        [self startDisplaying:test1];
+    } else {
+        [documents sortUsingSelector:@selector(localizedStandardCompare:)];
+        [self showDocumentList:documents inFolder:documentsDirectory];
+    }
 
     return YES;
 }
 
-- (void)threadMainMethod:(id)argument
+- (void)startDisplaying:(NSString*)documentPath;
 {
-    (void) argument;
+    ViewController *vc = [[ViewController alloc] init];
+    self.window.rootViewController = vc;
+
+    [[[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:documentPath] start];
+    vc.view = [[View alloc] initWithFrame:[self.window frame]];
+}
 
+- (void)threadMainMethod:(NSString *)documentPath
+{
     @autoreleasepool {
-        lo_initialize();
+        lo_initialize(documentPath);
         touch_lo_runMain();
     }
 }
 
+- (void)showDocumentList:(NSArray*)documents inFolder:(NSString*)folder
+{
+    UITableViewController *vc = [DocumentTableViewController createForDocuments:documents forAppDelegate:self];
+    self.window.rootViewController = vc;
+}
+
 - (void)applicationWillResignActive:(UIApplication *)application
 {
     // Sent when the application is about to move from active to
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.h b/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.h
new file mode 100644
index 0000000..ce5389a
--- /dev/null
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.h
@@ -0,0 +1,19 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+ at interface DocumentTableViewController : UITableViewController
+
++ (id)createForDocuments:(NSArray*)documents forAppDelegate:(AppDelegate*)appDelegate;
+
+ at end
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.m
new file mode 100644
index 0000000..27de342
--- /dev/null
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/DocumentTableViewController.m
@@ -0,0 +1,59 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+#import "DocumentTableViewController.h"
+
+ at interface DocumentTableViewController ()
+{
+    NSArray *documents;
+    AppDelegate *appDelegate;
+}
+ at end
+
+ at implementation DocumentTableViewController
+
++ (id)createForDocuments:(NSArray*)documents forAppDelegate:(AppDelegate*)appDelegate;
+{
+    DocumentTableViewController *result = [[DocumentTableViewController alloc] initWithStyle:UITableViewStylePlain];
+
+    result->documents = documents;
+    result->appDelegate = appDelegate;
+
+    return result;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    return [documents count];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    static NSString *simpleTableIdentifier = @"SimpleTableCell";
+
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
+
+    if (cell == nil) {
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
+    }
+
+    cell.textLabel.text = [[documents objectAtIndex:indexPath.row] lastPathComponent];
+    return cell;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    [appDelegate startDisplaying:[documents objectAtIndex:indexPath.row]];
+}
+
+ at end
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledLibreOffice-Info.plist b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledLibreOffice-Info.plist
index c20aa82..4110a9c 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledLibreOffice-Info.plist
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledLibreOffice-Info.plist
@@ -28,6 +28,8 @@
 	<array>
 		<string>armv7</string>
 	</array>
+	<key>UIFileSharingEnabled</key>
+	<true/>
 	<key>UISupportedInterfaceOrientations~ipad</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.h b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.h
index 0997c84..f22794d 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.h
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.h
@@ -6,11 +6,13 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#import <UIKit/UIKit.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void lo_initialize(void);
+void lo_initialize(NSString *documentPath);
 
 #ifdef __cplusplus
 }
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm
index 09cdc95..4f60d05 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm
@@ -38,19 +38,20 @@ static NSString *createPaths(NSString *base, NSString *appRootEscaped, NSArray *
     return result;
 }
 
-extern "C" void lo_initialize(void)
+extern "C" void lo_initialize(NSString *documentPath)
 {
-    NSString * bundlePath = [[NSBundle mainBundle] bundlePath];
-    NSString * app_root_escaped = [bundlePath stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
-    NSString * uno_types = createPaths(@"-env:UNO_TYPES=", app_root_escaped, @[@"offapi.rdb", @"oovbaapi.rdb", @"types.rdb"]);
-    NSString * uno_services = createPaths(@"-env:UNO_SERVICES=", app_root_escaped, @[@"ure/services.rdb", @"services.rdb"]);
+    NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
+    NSString *app_root_escaped = [bundlePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    NSString *uno_types = createPaths(@"-env:UNO_TYPES=", app_root_escaped, @[@"offapi.rdb", @"oovbaapi.rdb", @"types.rdb"]);
+    NSString *uno_services = createPaths(@"-env:UNO_SERVICES=", app_root_escaped, @[@"ure/services.rdb", @"services.rdb"]);
 
     const char *argv[] = {
         [[[NSBundle mainBundle] executablePath] UTF8String],
         "-env:URE_INTERNAL_LIB_DIR=file:///",
         [uno_types UTF8String],
         [uno_services UTF8String],
-        [[@"file://" stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: @"test1.odt"]] UTF8String]};
+        [[@"file://" stringByAppendingString: [documentPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] UTF8String]
+    };
 
     const int argc = sizeof(argv)/sizeof(*argv);
 


More information about the Libreoffice-commits mailing list