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

Stephan Bergmann sbergman at redhat.com
Thu Mar 20 07:04:45 PDT 2014


 framework/inc/classes/filtercache.hxx                       |    7 
 framework/inc/classes/filtercachedata.hxx                   |    5 
 framework/inc/classes/taskcreator.hxx                       |    3 
 framework/inc/dispatch/oxt_handler.hxx                      |    8 
 framework/inc/helper/statusindicator.hxx                    |    4 
 framework/inc/helper/statusindicatorfactory.hxx             |    5 
 framework/inc/helper/wakeupthread.hxx                       |    4 
 framework/inc/jobs/configaccess.hxx                         |    4 
 framework/inc/jobs/helponstartup.hxx                        |    6 
 framework/inc/jobs/shelljob.hxx                             |    4 
 framework/inc/services/contenthandlerfactory.hxx            |  171 ------------
 framework/inc/uielement/addonstoolbarmanager.hxx            |    1 
 framework/inc/uielement/constitemcontainer.hxx              |    1 
 framework/inc/uielement/itemcontainer.hxx                   |    1 
 framework/inc/uielement/progressbarwrapper.hxx              |    1 
 framework/inc/uielement/rootitemcontainer.hxx               |    4 
 framework/inc/uielement/statusindicatorinterfacewrapper.hxx |    1 
 framework/inc/xml/menudocumenthandler.hxx                   |    3 
 framework/source/classes/taskcreator.cxx                    |   19 -
 framework/source/dispatch/loaddispatcher.cxx                |    9 
 framework/source/dispatch/oxt_handler.cxx                   |   12 
 framework/source/dispatch/windowcommanddispatch.cxx         |   16 -
 framework/source/fwi/jobs/configaccess.cxx                  |   25 -
 framework/source/fwi/uielement/rootitemcontainer.cxx        |    6 
 framework/source/helper/statusindicator.cxx                 |   33 --
 framework/source/helper/statusindicatorfactory.cxx          |   79 +----
 framework/source/helper/wakeupthread.cxx                    |   11 
 framework/source/inc/dispatch/loaddispatcher.hxx            |    4 
 framework/source/inc/dispatch/windowcommanddispatch.hxx     |    5 
 framework/source/inc/loadenv/actionlockguard.hxx            |   30 --
 framework/source/jobs/helponstartup.cxx                     |   27 -
 framework/source/jobs/shelljob.cxx                          |   12 
 framework/source/services/desktop.cxx                       |    1 
 framework/source/services/frame.cxx                         |    1 
 34 files changed, 105 insertions(+), 418 deletions(-)

New commits:
commit aae139a391098984f6ef102e9745964d34746985
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 12:00:19 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: I8ab2c53566c9e62a1e03bc6010e2e13413be2c5f

diff --git a/framework/inc/classes/filtercachedata.hxx b/framework/inc/classes/filtercachedata.hxx
index dc566f7..00b541a 100644
--- a/framework/inc/classes/filtercachedata.hxx
+++ b/framework/inc/classes/filtercachedata.hxx
@@ -30,7 +30,6 @@
 #include <classes/checkediterator.hxx>
 #include <classes/wildcard.hxx>
 #include <classes/converter.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <general.h>
 
@@ -48,6 +47,8 @@
 
 namespace framework{
 
+class LockHelper;
+
 #define DEFAULT_FILTERCACHE_VERSION                 6                                                                   /// these implmentation of FilterCache support different version of TypeDetection.xml! This define the current set default one.
 
 #define DEFAULT_FILTERCACHE_MODE                    CONFIG_MODE_DELAYED_UPDATE | CONFIG_MODE_ALL_LOCALES                                          /// ConfigItems could run in different modes: supported values are ... { CONFIG_MODE_IMMEDIATE_UPDATE, CONFIG_MODE_DELAYED_UPDATE, CONFIG_MODE_ALL_LOCALES }
@@ -455,7 +456,7 @@ typedef ::std::vector< FilterHash::const_iterator >                 FilterQuery
 
 // Use private static data container to hold all values of configuration!
 
-class DataContainer : private ThreadHelpBase
+class DataContainer
 {
     public:
 
commit 4155b75632e414891673d7fd8fe38f98b41e8e12
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:59:27 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: Ia60e0af495b2141b7ea2e906d94c15c55865eea2

diff --git a/framework/inc/classes/filtercache.hxx b/framework/inc/classes/filtercache.hxx
index 797ba14..60ce7f3 100644
--- a/framework/inc/classes/filtercache.hxx
+++ b/framework/inc/classes/filtercache.hxx
@@ -28,7 +28,6 @@
 #define INCLUDED_FRAMEWORK_INC_CLASSES_FILTERCACHE_HXX
 
 #include <classes/filtercachedata.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 
 #include <threadhelp/transactionbase.hxx>
 #include <general.h>
@@ -56,15 +55,13 @@ namespace framework{
                     For better performance its necessary to cache all needed values.
 
     @implements     -
-    @base           ThreadHelpBase
-                    TransactionBase
+    @base           TransactionBase
 
     @devstatus      ready to use
     @threadsafe     yes
 *//*-*************************************************************************************************************/
 
-class FilterCache   :   private ThreadHelpBase
-                    ,   private TransactionBase
+class FilterCache   :   private TransactionBase
 {
     public:
 
commit 7e88a21a41b0d21532ebd8f686e056dcf8734c08
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:58:33 2014 +0100

    Remove dead code
    
    Change-Id: Ib148ca5cb8fce0a4d4b15fbb16d6f008dd62671f

diff --git a/framework/inc/services/contenthandlerfactory.hxx b/framework/inc/services/contenthandlerfactory.hxx
deleted file mode 100644
index af94e0b..0000000
--- a/framework/inc/services/contenthandlerfactory.hxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C++; 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_CONTENTHANDLERFACTORY_HXX
-#define INCLUDED_FRAMEWORK_INC_SERVICES_CONTENTHANDLERFACTORY_HXX
-
-#include <classes/filtercache.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-
-#include <threadhelp/transactionbase.hxx>
-#include <general.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-
-#include <cppuhelper/interfacecontainer.hxx>
-#include <cppuhelper/weak.hxx>
-
-namespace framework{
-
-/*-************************************************************************************************************
-    @short      factory to create handler-objects
-    @descr      These class can be used to create new handler for specified contents.
-                We use cached values of our configuration to lay down, which handler match
-                a given URL or handlername. (use service TypeDetection to do that)
-                With a detected type name you can search a registered handler and create it with these factory.
-
-    @implements XInterface
-                XTypeProvider
-                XServiceInfo
-                XMultiServiceFactory
-                XNameContainer
-                XNameReplace
-                XNameAccess
-                XElementAccess
-                XFlushable
-
-    @base       ThreadHelpBase
-                OWeakObject
-
-    @devstatus  ready to use
-    @threadsafe yes
-*//*-*************************************************************************************************************/
-
-class ContentHandlerFactory :   // interfaces
-                        public  css::lang::XTypeProvider            ,
-                        public  css::lang::XServiceInfo             ,
-                        public  css::lang::XMultiServiceFactory     ,
-                        public  css::container::XNameContainer      ,       // => XNameReplace => XNameAccess => XElementAccess
-                        public  css::util::XFlushable               ,
-                        // base classes
-                        // Order is necessary for right initialization of it!
-                        private ThreadHelpBase                      ,
-                        private TransactionBase                     ,
-                        public  ::cppu::OWeakObject
-{
-
-    //  public methods
-
-
-    public:
-
-
-        //  constructor / destructor
-
-                 ContentHandlerFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
-        virtual ~ContentHandlerFactory(                                                                        );
-
-
-        //  XInterface, XTypeProvider, XServiceInfo
-
-        DECLARE_XINTERFACE
-        DECLARE_XTYPEPROVIDER
-        DECLARE_XSERVICEINFO
-
-
-        //  XMultiServiceFactory
-
-        virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance             ( const OUString&                        sTypeName   ) throw( css::uno::Exception        ,
-                                                                                                                                                                     css::uno::RuntimeException );
-        virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString&                        sTypeName   ,
-                                                                                                  const css::uno::Sequence< css::uno::Any >&    lArguments  ) throw( css::uno::Exception, css::uno::RuntimeException );
-        virtual css::uno::Sequence< OUString >       SAL_CALL getAvailableServiceNames   (                                                           ) throw( css::uno::RuntimeException );
-
-
-        //  XNameContainer
-
-        virtual void SAL_CALL insertByName( const OUString&  sHandlerName        ,
-                                            const css::uno::Any&    aHandlerProperties  ) throw( css::lang::IllegalArgumentException     ,
-                                                                                                 css::container::ElementExistException   ,
-                                                                                                 css::lang::WrappedTargetException       ,
-                                                                                                 css::uno::RuntimeException              );
-        virtual void SAL_CALL removeByName( const OUString&  sHandlerName        ) throw( css::container::NoSuchElementException  ,
-                                                                                                 css::lang::WrappedTargetException       ,
-                                                                                                 css::uno::RuntimeException              );
-
-
-        //  XNameReplace
-
-        virtual void SAL_CALL replaceByName( const OUString& sHandlerName       ,
-                                             const css::uno::Any&   aHandlerProperties ) throw( css::lang::IllegalArgumentException    ,
-                                                                                                css::container::NoSuchElementException ,
-                                                                                                css::lang::WrappedTargetException      ,
-                                                                                                css::uno::RuntimeException             );
-
-
-        //  XNameAccess
-
-        virtual css::uno::Any                         SAL_CALL getByName      ( const OUString& sName ) throw( css::container::NoSuchElementException ,
-                                                                                                                      css::lang::WrappedTargetException      ,
-                                                                                                                      css::uno::RuntimeException             );
-        virtual css::uno::Sequence< OUString > SAL_CALL getElementNames(                              ) throw( css::uno::RuntimeException             );
-        virtual sal_Bool                              SAL_CALL hasByName      ( const OUString& sName ) throw( css::uno::RuntimeException             );
-
-
-        //  XElementAccess
-
-        virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException );
-        virtual sal_Bool       SAL_CALL hasElements   () throw( css::uno::RuntimeException );
-
-
-        //  XFlushable
-
-        virtual void SAL_CALL flush              (                                                                   ) throw ( css::uno::RuntimeException );
-        virtual void SAL_CALL addFlushListener   ( const css::uno::Reference< css::util::XFlushListener >& xListener ) throw ( css::uno::RuntimeException );
-        virtual void SAL_CALL removeFlushListener( const css::uno::Reference< css::util::XFlushListener >& xListener ) throw ( css::uno::RuntimeException );
-
-
-    //  private variables
-    //  (should be private everyway!)
-
-
-    private:
-
-        css::uno::Reference< css::lang::XMultiServiceFactory >      m_xFactory              ;
-        FilterCache                                                 m_aCache                ;
-
-};      //  class ContentHandlerFactory
-
-}       //  namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_SERVICES_CONTENTHANDLERFACTORY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit be1df5d2f1d3b46303acc5d5c447dcfbaa9e466c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:55:03 2014 +0100

    Remove unused includes
    
    Change-Id: Ia3b3ce4e9e3504e3b9e4a623879893755dcd1ba9

diff --git a/framework/inc/uielement/addonstoolbarmanager.hxx b/framework/inc/uielement/addonstoolbarmanager.hxx
index ecb3a97..7eef342 100644
--- a/framework/inc/uielement/addonstoolbarmanager.hxx
+++ b/framework/inc/uielement/addonstoolbarmanager.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_ADDONSTOOLBARMANAGER_HXX
 
 #include <uielement/toolbarmanager.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
diff --git a/framework/inc/uielement/constitemcontainer.hxx b/framework/inc/uielement/constitemcontainer.hxx
index 9500d81..c1d751a 100644
--- a/framework/inc/uielement/constitemcontainer.hxx
+++ b/framework/inc/uielement/constitemcontainer.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_CONSTITEMCONTAINER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_CONSTITEMCONTAINER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
diff --git a/framework/inc/uielement/itemcontainer.hxx b/framework/inc/uielement/itemcontainer.hxx
index 95ba6d3..67f4d45 100644
--- a/framework/inc/uielement/itemcontainer.hxx
+++ b/framework/inc/uielement/itemcontainer.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_ITEMCONTAINER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_ITEMCONTAINER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
diff --git a/framework/inc/uielement/progressbarwrapper.hxx b/framework/inc/uielement/progressbarwrapper.hxx
index 0d883d0..c3bfde7 100644
--- a/framework/inc/uielement/progressbarwrapper.hxx
+++ b/framework/inc/uielement/progressbarwrapper.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_PROGRESSBARWRAPPER_HXX
 
 #include <helper/uielementwrapperbase.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
diff --git a/framework/inc/uielement/statusindicatorinterfacewrapper.hxx b/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
index c4fcfbe..2b1a5db 100644
--- a/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
+++ b/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSINDICATORINTERFACEWRAPPER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSINDICATORINTERFACEWRAPPER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
commit e3848f6d3f79a558d2f225801b6bb3cea452dfeb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:53:12 2014 +0100

    Remove unused ThreadHelpBase base
    
    Change-Id: Id08d2c937a5d41c74852bb14ac726d87853dfc7e

diff --git a/framework/inc/xml/menudocumenthandler.hxx b/framework/inc/xml/menudocumenthandler.hxx
index 30cbc93..34e41e2 100644
--- a/framework/inc/xml/menudocumenthandler.hxx
+++ b/framework/inc/xml/menudocumenthandler.hxx
@@ -27,7 +27,6 @@
 #include <com/sun/star/uno/Sequence.h>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <rtl/ustring.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -35,7 +34,7 @@
 
 namespace framework{
 
-class FWE_DLLPUBLIC ReadMenuDocumentHandlerBase : public ThreadHelpBase,    // Struct for right initalization of mutex member! Must be first of baseclasses.
+class FWE_DLLPUBLIC ReadMenuDocumentHandlerBase :
                                     public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
 {
     public:
commit 614742430223b2ea90b0b099323cc7e8fc352473
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:51:31 2014 +0100

    Access safe members directly
    
    Change-Id: Ie76f2219c5bce609a23a0bc70d6da43f527ce12d

diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx
index aaef28c..f0aac5d 100644
--- a/framework/inc/classes/taskcreator.hxx
+++ b/framework/inc/classes/taskcreator.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_TASKCREATOR_HXX
 #define INCLUDED_FRAMEWORK_INC_CLASSES_TASKCREATOR_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <general.h>
 
@@ -41,7 +40,7 @@ namespace framework{
     @devstatus      ready to use
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class TaskCreator : private ThreadHelpBase
+class TaskCreator
 {
 
     // member
diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx
index b63c926..b7b850a 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <classes/taskcreator.hxx>
-#include <threadhelp/guard.hxx>
 #include <loadenv/targethelper.hxx>
 #include <services.h>
 #include <taskcreatordefs.hxx>
@@ -43,8 +42,7 @@ namespace framework{
                     points to the valid uno service manager
 *//*-*****************************************************************************************************/
 TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext )
-    : ThreadHelpBase(       )
-    , m_xContext    ( xContext )
+    : m_xContext    ( xContext )
 {
 }
 
@@ -54,7 +52,6 @@ TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext
 *//*-*****************************************************************************************************/
 TaskCreator::~TaskCreator()
 {
-    m_xContext.clear();
 }
 
 /*-****************************************************************************************************
@@ -63,12 +60,6 @@ TaskCreator::~TaskCreator()
 css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUString& sName    ,
                                                                          sal_Bool         bVisible )
 {
-    /* SAFE { */
-    Guard aReadLock( m_aLock );
-    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
-    aReadLock.unlock();
-    /* } SAFE */
-
     css::uno::Reference< css::lang::XSingleServiceFactory > xCreator;
     OUString sCreator = IMPLEMENTATIONNAME_FWK_TASKCREATOR;
 
@@ -80,12 +71,12 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
            )
         {
 
-            boost::optional<OUString> x(officecfg::Office::TabBrowse::TaskCreatorService::ImplementationName::get(xContext));
+            boost::optional<OUString> x(officecfg::Office::TabBrowse::TaskCreatorService::ImplementationName::get(m_xContext));
             if (x) sCreator = x.get();
         }
 
         xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
-                    xContext->getServiceManager()->createInstanceWithContext(sCreator, xContext), css::uno::UNO_QUERY_THROW);
+                    m_xContext->getServiceManager()->createInstanceWithContext(sCreator, m_xContext), css::uno::UNO_QUERY_THROW);
     }
     catch(const css::uno::Exception&)
     {}
@@ -95,13 +86,13 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
     // BTW: The used fallback creator service (IMPLEMENTATIONNAME_FWK_TASKCREATOR) is implemented in the same
     // library then these class here ... Why we should not be able to create it ?
     if ( ! xCreator.is())
-        xCreator = css::frame::TaskCreator::create(xContext);
+        xCreator = css::frame::TaskCreator::create(m_xContext);
 
     css::uno::Sequence< css::uno::Any > lArgs(5);
     css::beans::NamedValue              aArg    ;
 
     aArg.Name    = OUString(ARGUMENT_PARENTFRAME);
-    aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
+    aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY_THROW);
     lArgs[0]   <<= aArg;
 
     aArg.Name    = OUString(ARGUMENT_CREATETOPWINDOW);
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 44948d3..028397d 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -28,6 +28,7 @@
 
 #include <dispatch/interceptionhelper.hxx>
 #include <classes/taskcreator.hxx>
+#include <threadhelp/lockhelper.hxx>
 #include <threadhelp/transactionguard.hxx>
 #include <general.h>
 #include <properties.h>
commit d8910d12b897e622f4b5f8a47d8a10fe77efbef8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:49:39 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I4adad36de95c022a7945b61a44bb6166ad87a8a7

diff --git a/framework/inc/dispatch/oxt_handler.hxx b/framework/inc/dispatch/oxt_handler.hxx
index 7ce5f92..c3676c0 100644
--- a/framework/inc/dispatch/oxt_handler.hxx
+++ b/framework/inc/dispatch/oxt_handler.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
 #define INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <macros/xserviceinfo.hxx>
@@ -53,11 +52,7 @@ namespace framework{
     @devstatus      ready
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class Oxt_Handler  :    // baseclasses
-                        // Order is necessary for right initialization!
-                        private ThreadHelpBase
-                        // interfaces
-                    ,   public  ::cppu::WeakImplHelper3<
+class Oxt_Handler  :    public  ::cppu::WeakImplHelper3<
                                     css::lang::XServiceInfo,
                                     css::frame::XNotifyingDispatch, // => XDispatch
                                     css::document::XExtendedFilterDetection >
@@ -114,6 +109,7 @@ class Oxt_Handler  :    // baseclasses
     //  (should be private everyway!)
 
     private:
+        osl::Mutex m_mutex;
 
         css::uno::Reference< css::lang::XMultiServiceFactory >     m_xFactory          ;   /// global uno service factory to create new services
         css::uno::Reference< css::uno::XInterface >                m_xSelfHold         ;   /// we must protect us against dieing during async(!) dispatch() call!
diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx
index b24eaec..488f6b4 100644
--- a/framework/source/dispatch/oxt_handler.cxx
+++ b/framework/source/dispatch/oxt_handler.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <dispatch/oxt_handler.hxx>
-#include <threadhelp/guard.hxx>
 #include <threadhelp/transactionguard.hxx>
 #include <services.h>
 #include <unotools/mediadescriptor.hxx>
@@ -60,10 +59,7 @@ DEFINE_INIT_SERVICE                 (   Oxt_Handler,
     @threadsafe yes
 *//*-*************************************************************************************************************/
 Oxt_Handler::Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory )
-        //  Init baseclasses first
-        :   ThreadHelpBase      (          )
-        // Init member
-        ,   m_xFactory          ( xFactory )
+        :   m_xFactory          ( xFactory )
 {
 }
 
@@ -117,8 +113,7 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL,
                                                      const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
     throw( css::uno::RuntimeException, std::exception )
 {
-    // SAFE {
-    Guard aLock( m_aLock );
+    osl::MutexGuard g(m_mutex);
 
     OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog";
     css::uno::Sequence< css::uno::Any > lParams(1);
@@ -137,9 +132,6 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL,
         aEvent.State = css::frame::DispatchResultState::SUCCESS;
         xListener->dispatchFinished( aEvent );
     }
-
-    // } SAFE
-    aLock.unlock();
 }
 
 void SAL_CALL Oxt_Handler::dispatch( const css::util::URL&                                  aURL       ,
commit 8114055880ef14999058cd549dd7bda83cbf1c69
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:49:25 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I37264f25b5ad89f72d25f78808ff796f581536c4

diff --git a/framework/inc/jobs/configaccess.hxx b/framework/inc/jobs/configaccess.hxx
index de0ee8a..be5b464 100644
--- a/framework/inc/jobs/configaccess.hxx
+++ b/framework/inc/jobs/configaccess.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_JOBS_CONFIGACCESS_HXX
 #define INCLUDED_FRAMEWORK_INC_JOBS_CONFIGACCESS_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <general.h>
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -39,7 +38,7 @@ namespace framework{
             instead of using soecialize config items of the svtools
             project. This class can wrapp such configuration access.
  */
-class FWI_DLLPUBLIC ConfigAccess : public ThreadHelpBase
+class FWI_DLLPUBLIC ConfigAccess
 {
 
 
@@ -60,6 +59,7 @@ class FWI_DLLPUBLIC ConfigAccess : public ThreadHelpBase
     // member
 
     private:
+        mutable osl::Mutex m_mutex;
 
         /**
             reference to the uno service manager
diff --git a/framework/source/fwi/jobs/configaccess.cxx b/framework/source/fwi/jobs/configaccess.cxx
index f83d429..fb88bff 100644
--- a/framework/source/fwi/jobs/configaccess.cxx
+++ b/framework/source/fwi/jobs/configaccess.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <jobs/configaccess.hxx>
-#include <threadhelp/guard.hxx>
 #include <general.h>
 #include <services.h>
 
@@ -47,8 +46,7 @@ namespace framework{
  */
 ConfigAccess::ConfigAccess( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& rxContext,
                             /*IN*/ const OUString&                                    sRoot )
-    : ThreadHelpBase(          )
-    , m_xContext    ( rxContext)
+    : m_xContext    ( rxContext)
     , m_sRoot       ( sRoot    )
     , m_eMode       ( E_CLOSED )
 {
@@ -76,10 +74,8 @@ ConfigAccess::~ConfigAccess()
  */
 ConfigAccess::EOpenMode ConfigAccess::getMode() const
 {
-    /* SAFE { */
-    Guard aReadLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
     return m_eMode;
-    /* } SAFE */
 }
 
 
@@ -99,10 +95,7 @@ ConfigAccess::EOpenMode ConfigAccess::getMode() const
  */
 void ConfigAccess::open( /*IN*/ EOpenMode eMode )
 {
-    /* SAFE { */
-    // We must lock the whole method to be shure, that nobody
-    // outside uses our internal member m_xAccess!
-    Guard aWriteLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
 
     // check if configuration is already open in the right mode.
     // By the way: Don't allow closing by using this method!
@@ -146,9 +139,6 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode )
         if (m_xConfig.is())
             m_eMode = eMode;
     }
-
-    aWriteLock.unlock();
-    /* } SAFE */
 }
 
 
@@ -159,11 +149,7 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode )
  */
 void ConfigAccess::close()
 {
-    /* SAFE { */
-    // Lock the whole method, to be shure that nobody else uses our internal members
-    // during this time.
-    Guard aWriteLock(m_aLock);
-
+    osl::MutexGuard g(m_mutex);
     // check already closed configuration
     if (m_xConfig.is())
     {
@@ -173,9 +159,6 @@ void ConfigAccess::close()
         m_xConfig = css::uno::Reference< css::uno::XInterface >();
         m_eMode   = E_CLOSED;
     }
-
-    aWriteLock.unlock();
-    /* } SAFE */
 }
 
 
commit f9c73e458f0be91f0034f98b3876cfbd4233371b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:42:02 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I2ec909c81faabd896310b29b0d7149b0f7744b35

diff --git a/framework/inc/uielement/rootitemcontainer.hxx b/framework/inc/uielement/rootitemcontainer.hxx
index 3403975..5bd06a5 100644
--- a/framework/inc/uielement/rootitemcontainer.hxx
+++ b/framework/inc/uielement/rootitemcontainer.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_ROOTITEMCONTAINER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_ROOTITEMCONTAINER_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
@@ -34,6 +33,7 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 
 #include <rtl/ustring.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/propshlp.hxx>
 
@@ -49,7 +49,7 @@ typedef ::cppu::WeakImplHelper3<
             css::lang::XSingleComponentFactory,
             css::lang::XUnoTunnel > RootItemContainer_BASE;
 
-class RootItemContainer :   protected ThreadHelpBase                                ,
+class RootItemContainer :   private cppu::BaseMutex,
                             public ::cppu::OBroadcastHelper                         ,
                             public ::cppu::OPropertySetHelper                       ,
                             public RootItemContainer_BASE
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index 712cb2c..0d209ca 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -45,15 +45,13 @@ namespace framework
 {
 
 RootItemContainer::RootItemContainer()
-    :   ThreadHelpBase              ( )
-    ,   ::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)) )
 {
 }
 
 RootItemContainer::RootItemContainer( const Reference< XIndexAccess >& rSourceContainer )
-    :   ThreadHelpBase              ( )
-    ,   ::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)) )
 {
     // We also have to copy the UIName property
commit dd7b477e9dea0af0e23b5ac51f41421ad9af43cc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:39:54 2014 +0100

    Access safe members directly
    
    Change-Id: Ib1195f4704de845448e280fabbe40580de46a97d

diff --git a/framework/inc/helper/statusindicator.hxx b/framework/inc/helper/statusindicator.hxx
index a5ddac5..adda81a 100644
--- a/framework/inc/helper/statusindicator.hxx
+++ b/framework/inc/helper/statusindicator.hxx
@@ -24,7 +24,6 @@
 // include files of own module
 
 #include <helper/statusindicatorfactory.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <macros/generic.hxx>
@@ -59,8 +58,7 @@ namespace framework{
     @devstatus      ready to use
     @threadsafe     yes
 */
-class StatusIndicator : private ThreadHelpBase                  // Order of baseclasses is necessary for right initializaton!
-                      , public  ::cppu::WeakImplHelper1< css::task::XStatusIndicator >
+class StatusIndicator : public  ::cppu::WeakImplHelper1< css::task::XStatusIndicator >
 {
 
     // member
diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx
index 61d2521..ab9e4cc8 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -28,8 +28,7 @@ namespace framework{
 
 
 StatusIndicator::StatusIndicator(StatusIndicatorFactory* pFactory)
-    : ThreadHelpBase     (        )
-    , m_xFactory         (pFactory)
+    : m_xFactory         (pFactory)
 {
 }
 
@@ -47,11 +46,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText ,
     (void) sText;
     (void) nRange;
 #else
-    // SAFE ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SAFE
+    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     if (xFactory.is())
     {
         StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get();
@@ -65,11 +60,7 @@ void SAL_CALL StatusIndicator::end()
     throw(css::uno::RuntimeException, std::exception)
 {
 #if HAVE_FEATURE_DESKTOP
-    // SAFE ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SAFE
+    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     if (xFactory.is())
     {
         StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get();
@@ -83,11 +74,7 @@ void SAL_CALL StatusIndicator::reset()
     throw(css::uno::RuntimeException, std::exception)
 {
 #if HAVE_FEATURE_DESKTOP
-    // SAFE ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SAFE
+    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     if (xFactory.is())
     {
         StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get();
@@ -103,11 +90,7 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText)
 #if !HAVE_FEATURE_DESKTOP
     (void) sText;
 #else
-    // SAFE ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SAFE
+    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     if (xFactory.is())
     {
         StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get();
@@ -123,11 +106,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
 #if !HAVE_FEATURE_DESKTOP
     (void) nValue;
 #else
-    // SAFE ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY);
-    aReadLock.unlock();
-    // <- SAFE
+    css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     if (xFactory.is())
     {
         StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get();
commit 4f843f2bc87952131085cf7e88ab69b6e18fbe37
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:37:15 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: Icb655df89fcb3c9dac0f25d0fdb5383d24914877

diff --git a/framework/inc/helper/statusindicatorfactory.hxx b/framework/inc/helper/statusindicatorfactory.hxx
index 57c8271..3e68c93 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -27,7 +27,6 @@
 
 // include files of own module
 #include <helper/wakeupthread.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <macros/xserviceinfo.hxx>
@@ -151,8 +150,7 @@ typedef ::std::vector< IndicatorInfo > IndicatorStack;
     @devstatus      ready to use
     @threadsafe     yes
  */
-class StatusIndicatorFactory : private ThreadHelpBase
-                             , public  ::cppu::WeakImplHelper4<
+class StatusIndicatorFactory : public  ::cppu::WeakImplHelper4<
                                              css::lang::XServiceInfo
                                            , css::lang::XInitialization
                                            , css::task::XStatusIndicatorFactory
@@ -161,6 +159,7 @@ class StatusIndicatorFactory : private ThreadHelpBase
 
     // member
     private:
+        osl::Mutex m_mutex;
 
         /** stack with all current indicator children. */
         IndicatorStack m_aStack;
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index 794f7cf..944a528 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -55,8 +55,7 @@ const char PROGRESS_RESOURCE[] = "private:resource/progressbar/progressbar";
 
 
 StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext)
-    : ThreadHelpBase      (         )
-    , m_xContext          (xContext )
+    : m_xContext          (xContext )
     , m_pWakeUp           (0        )
     , m_bAllowReschedule  (sal_False)
     , m_bAllowParentShow  (sal_False)
@@ -76,8 +75,7 @@ void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< css::
           css::uno::RuntimeException, std::exception)
 {
     if (lArguments.getLength() > 0) {
-        // SAFE -> ----------------------------------
-        Guard aWriteLock(m_aLock);
+        osl::MutexGuard g(m_mutex);
 
         css::uno::Reference< css::frame::XFrame > xTmpFrame;
         css::uno::Reference< css::awt::XWindow > xTmpWindow;
@@ -101,9 +99,6 @@ void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< css::
             m_xPluggWindow       = lArgs.getUnpackedValueOrDefault("Window"           , css::uno::Reference< css::awt::XWindow >() );
             m_bAllowParentShow   = lArgs.getUnpackedValueOrDefault("AllowParentShow"  , (sal_Bool)sal_False                        );
             m_bDisableReschedule = lArgs.getUnpackedValueOrDefault("DisableReschedule", (sal_Bool)sal_False                        );
-
-            aWriteLock.unlock();
-           // <- SAFE ----------------------------------
        }
     }
 
@@ -124,11 +119,8 @@ css::uno::Reference< css::task::XStatusIndicator > SAL_CALL StatusIndicatorFacto
 void SAL_CALL StatusIndicatorFactory::update()
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
     m_bAllowReschedule = sal_True;
-    aWriteLock.unlock();
-    // <- SAFE ----------------------------------
 }
 
 
@@ -137,7 +129,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus
                                          sal_Int32                                           nRange)
 {
     // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::ClearableMutexGuard aWriteLock(m_mutex);
 
     // create new info structure for this child or move it to the front of our stack
     IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -149,7 +141,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus
     m_xActiveChild = xChild;
     css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
 
-    aWriteLock.unlock();
+    aWriteLock.clear();
     // <- SAFE ----------------------------------
 
     implts_makeParentVisibleIfAllowed();
@@ -165,7 +157,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus
 void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatusIndicator >& xChild)
 {
     // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
 
     // reset the internal info structure related to this child
     IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -178,7 +170,7 @@ void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatus
     css::uno::Reference< css::task::XStatusIndicator > xActive   = m_xActiveChild;
     css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
 
-    aReadLock.unlock();
+    aReadLock.clear();
     // <- SAFE ----------------------------------
 
     // not the top most child => dont change UI
@@ -196,7 +188,7 @@ void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatus
 void StatusIndicatorFactory::end(const css::uno::Reference< css::task::XStatusIndicator >& xChild)
 {
     // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::ClearableMutexGuard aWriteLock(m_mutex);
 
     // remove this child from our stack
     IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -218,7 +210,7 @@ void StatusIndicatorFactory::end(const css::uno::Reference< css::task::XStatusIn
     css::uno::Reference< css::task::XStatusIndicator > xActive   = m_xActiveChild;
     css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
 
-    aWriteLock.unlock();
+    aWriteLock.clear();
     // <- SAFE ----------------------------------
 
     if (xActive.is())
@@ -251,7 +243,7 @@ void StatusIndicatorFactory::setText(const css::uno::Reference< css::task::XStat
                                      const OUString&                                    sText )
 {
     // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::ClearableMutexGuard aWriteLock(m_mutex);
 
     IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
     if (pItem != m_aStack.end())
@@ -260,7 +252,7 @@ void StatusIndicatorFactory::setText(const css::uno::Reference< css::task::XStat
     css::uno::Reference< css::task::XStatusIndicator > xActive   = m_xActiveChild;
     css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
 
-    aWriteLock.unlock();
+    aWriteLock.clear();
     // SAFE -> ----------------------------------
 
     // paint only the top most indicator
@@ -281,7 +273,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt
                                              sal_Int32                                           nValue )
 {
     // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::ClearableMutexGuard aWriteLock(m_mutex);
 
     sal_Int32 nOldValue = 0;
     IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -294,7 +286,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt
     css::uno::Reference< css::task::XStatusIndicator > xActive    = m_xActiveChild;
     css::uno::Reference< css::task::XStatusIndicator > xProgress  = m_xProgress;
 
-    aWriteLock.unlock();
+    aWriteLock.clear();
     // SAFE -> ----------------------------------
 
     if (
@@ -313,7 +305,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt
 void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
 {
     // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
 
     if (!m_bAllowParentShow)
         return;
@@ -322,7 +314,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
     css::uno::Reference< css::awt::XWindow >  xPluggWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
     css::uno::Reference< css::uno::XComponentContext > xContext( m_xContext);
 
-    aReadLock.unlock();
+    aReadLock.clear();
     // <- SAFE ----------------------------------
 
     css::uno::Reference< css::awt::XWindow > xParentWindow;
@@ -406,12 +398,12 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
 void StatusIndicatorFactory::impl_createProgress()
 {
     // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
 
-    aReadLock.lock();
+    aReadLock.clear();
     // <- SAFE ----------------------------------
 
     css::uno::Reference< css::task::XStatusIndicator > xProgress;
@@ -445,23 +437,20 @@ void StatusIndicatorFactory::impl_createProgress()
         }
     }
 
-    // SAFE -> ----------------------------------
-    Guard aWriteLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
     m_xProgress = xProgress;
-    aWriteLock.lock();
-    // <- SAFE ----------------------------------
 }
 
 
 void StatusIndicatorFactory::impl_showProgress()
 {
     // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
 
-    aReadLock.lock();
+    aReadLock.clear();
     // <- SAFE ----------------------------------
 
     css::uno::Reference< css::task::XStatusIndicator > xProgress;
@@ -489,11 +478,8 @@ void StatusIndicatorFactory::impl_showProgress()
             }
         }
 
-        // SAFE -> ----------------------------------
-        Guard aWriteLock(m_aLock);
+        osl::MutexGuard g(m_mutex);
         m_xProgress = xProgress;
-        aWriteLock.lock();
-        // <- SAFE ----------------------------------
     }
 }
 
@@ -501,12 +487,12 @@ void StatusIndicatorFactory::impl_showProgress()
 void StatusIndicatorFactory::impl_hideProgress()
 {
     // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
 
-    aReadLock.lock();
+    aReadLock.clear();
     // <- SAFE ----------------------------------
 
     if (xFrame.is())
@@ -527,21 +513,18 @@ void StatusIndicatorFactory::impl_hideProgress()
 void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce)
 {
     // SAFE ->
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
     if (m_bDisableReschedule)
         return;
-    aReadLock.unlock();
+    aReadLock.clear();
     // <- SAFE
 
     sal_Bool bReschedule = bForce;
     if (!bReschedule)
     {
-        // SAFE ->
-        Guard aWriteLock(m_aLock);
+        osl::MutexGuard g(m_mutex);
         bReschedule        = m_bAllowReschedule;
         m_bAllowReschedule = sal_False;
-        aWriteLock.unlock();
-        // <- SAFE
     }
 
     if (!bReschedule)
@@ -570,8 +553,7 @@ void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce)
 
 void StatusIndicatorFactory::impl_startWakeUpThread()
 {
-    // SAFE ->
-    Guard aWriteLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
 
     if (m_bDisableReschedule)
         return;
@@ -581,23 +563,18 @@ void StatusIndicatorFactory::impl_startWakeUpThread()
         m_pWakeUp = new WakeUpThread(this);
         m_pWakeUp->create();
     }
-    aWriteLock.unlock();
-    // <- SAFE
 }
 
 
 void StatusIndicatorFactory::impl_stopWakeUpThread()
 {
-    // SAFE ->
-    Guard aWriteLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
     if (m_pWakeUp)
     {
         // Thread kill itself after terminate()!
         m_pWakeUp->terminate();
         m_pWakeUp = 0;
     }
-    aWriteLock.unlock();
-    // <- SAFE
 }
 
 } // namespace framework
commit ed15977626b71ad4e23461596ee4994f79557470
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:30:51 2014 +0100

    Access safe members directly
    
    Change-Id: I184f6450dc436b37fefe6c6ca35f61296ec10dd6

diff --git a/framework/inc/helper/wakeupthread.hxx b/framework/inc/helper/wakeupthread.hxx
index 4c46beb..8265b7c 100644
--- a/framework/inc/helper/wakeupthread.hxx
+++ b/framework/inc/helper/wakeupthread.hxx
@@ -23,7 +23,6 @@
 
 // include files of own module
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/generic.hxx>
 
 #include <general.h>
@@ -45,8 +44,7 @@ namespace framework{
 
 /** @short  implements a "sleeping" thread, which try to sleep
             without a using cpu consumption :-) */
-class WakeUpThread : public ThreadHelpBase
-                   , public ::osl::Thread
+class WakeUpThread : public ::osl::Thread
 {
 
     // member
diff --git a/framework/source/helper/wakeupthread.cxx b/framework/source/helper/wakeupthread.cxx
index 97b60f7..b0cd2a9 100644
--- a/framework/source/helper/wakeupthread.cxx
+++ b/framework/source/helper/wakeupthread.cxx
@@ -23,15 +23,13 @@
 
 // include files of own module
 #include <helper/wakeupthread.hxx>
-#include <threadhelp/guard.hxx>
 
 namespace framework{
 
 
 
 WakeUpThread::WakeUpThread(const css::uno::Reference< css::util::XUpdatable >& xListener)
-    : ThreadHelpBase(         )
-    , m_xListener   (xListener)
+    : m_xListener   (xListener)
 {
 }
 
@@ -49,12 +47,7 @@ void SAL_CALL WakeUpThread::run()
         aSleeper.reset();
         aSleeper.wait(&aTime);
 
-        // SAFE ->
-        Guard aReadLock(m_aLock);
-        css::uno::Reference< css::util::XUpdatable > xListener(m_xListener.get(), css::uno::UNO_QUERY);
-        aReadLock.unlock();
-        // <- SAFE
-
+        css::uno::Reference< css::util::XUpdatable > xListener(m_xListener);
         if (xListener.is())
             xListener->update();
     }
commit 9a110fff7d6d6ba296f896f85a4aeed0d0955350
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:22:32 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I4f483efd13c099348f06094573c499858a8431ba

diff --git a/framework/source/dispatch/loaddispatcher.cxx b/framework/source/dispatch/loaddispatcher.cxx
index 3d90d03..7df7167 100644
--- a/framework/source/dispatch/loaddispatcher.cxx
+++ b/framework/source/dispatch/loaddispatcher.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <dispatch/loaddispatcher.hxx>
-#include <threadhelp/guard.hxx>
 
 #include <com/sun/star/frame/DispatchResultState.hpp>
 
@@ -28,8 +27,7 @@ LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::uno::XComponentCo
                                const css::uno::Reference< css::frame::XFrame >&          xOwnerFrame ,
                                const OUString&                                           sTargetName ,
                                      sal_Int32                                           nSearchFlags)
-    : ThreadHelpBase(            )
-    , m_xContext    (xContext    )
+    : m_xContext    (xContext    )
     , m_xOwnerFrame (xOwnerFrame )
     , m_sTarget     (sTargetName )
     , m_nSearchFlags(nSearchFlags)
@@ -85,8 +83,7 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL,
     // and clear our reference ...) we should hold us self alive!
     css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::frame::XNotifyingDispatch* >(this), css::uno::UNO_QUERY);
 
-    // SAFE -> ----------------------------------
-    Guard aReadLock(m_aLock);
+    osl::MutexGuard g(m_mutex);
 
     // We are the only client of this load env object ... but
     // may a dispatch request before is still in progress (?!).
@@ -151,8 +148,6 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL,
     if ( xComponent.is () )
         aRet = css::uno::makeAny( xComponent );
 
-    aReadLock.unlock();
-    // <- SAFE ----------------------------------
     return aRet;
 }
 
diff --git a/framework/source/inc/dispatch/loaddispatcher.hxx b/framework/source/inc/dispatch/loaddispatcher.hxx
index b8b6666..374ac29 100644
--- a/framework/source/inc/dispatch/loaddispatcher.hxx
+++ b/framework/source/inc/dispatch/loaddispatcher.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_LOADDISPATCHER_HXX
 
 #include <loadenv/loadenv.hxx>
-#include <threadhelp/threadhelpbase.hxx>
 
 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
@@ -36,14 +35,14 @@ namespace framework{
 
     @author     as96863
  */
-class LoadDispatcher : private ThreadHelpBase
-                     , public  ::cppu::WeakImplHelper2< css::frame::XNotifyingDispatch,          // => XDispatch => XInterface
+class LoadDispatcher : public  ::cppu::WeakImplHelper2< css::frame::XNotifyingDispatch,          // => XDispatch => XInterface
                                                         css::frame::XSynchronousDispatch >
 {
 
     // member
 
     private:
+        osl::Mutex m_mutex;
 
         /** @short  can be used to create own needed services on demand. */
         css::uno::Reference< css::uno::XComponentContext > m_xContext;
commit 3d07d18a1828ef27179df119caae2ac62e5831dd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:20:57 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I49b88214bca33add9f9ea3d81870d54e40c5255b

diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx
index 51b88ff..cb47da8 100644
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <dispatch/windowcommanddispatch.hxx>
-#include <threadhelp/guard.hxx>
 #include <targets.h>
 #include <services.h>
 
@@ -40,8 +39,7 @@ namespace framework{
 
 WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
                          const css::uno::Reference< css::frame::XFrame >&              xFrame)
-    : ThreadHelpBase(                            )
-    , m_xContext    (xContext                    )
+    : m_xContext    (xContext                    )
     , m_xFrame      (xFrame                      )
     , m_xWindow     (xFrame->getContainerWindow())
 {
@@ -58,9 +56,9 @@ WindowCommandDispatch::~WindowCommandDispatch()
 
 void WindowCommandDispatch::impl_startListening()
 {
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
     css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY );
-    aReadLock.unlock();
+    aReadLock.clear();
 
     if ( ! xWindow.is())
         return;
@@ -78,9 +76,9 @@ void WindowCommandDispatch::impl_startListening()
 
 void WindowCommandDispatch::impl_stopListening()
 {
-    Guard aReadLock(m_aLock);
+    osl::ClearableMutexGuard aReadLock(m_mutex);
     css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY );
-    aReadLock.unlock();
+    aReadLock.clear();
 
     if (!xWindow.is())
         return;
@@ -152,10 +150,10 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
     try
     {
         // SYNCHRONIZED ->
-        Guard aReadLock(m_aLock);
+        osl::ClearableMutexGuard aReadLock(m_mutex);
         css::uno::Reference< css::frame::XDispatchProvider >   xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW);
         css::uno::Reference< css::uno::XComponentContext >     xContext    = m_xContext;
-        aReadLock.unlock();
+        aReadLock.clear();
         // <- SYNCHRONIZED
 
         // check provider ... we know it's weak reference only
diff --git a/framework/source/inc/dispatch/windowcommanddispatch.hxx b/framework/source/inc/dispatch/windowcommanddispatch.hxx
index 2c0ff5f..6436b32 100644
--- a/framework/source/inc/dispatch/windowcommanddispatch.hxx
+++ b/framework/source/inc/dispatch/windowcommanddispatch.hxx
@@ -20,8 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_WINDOWCOMMANDDISPATCH_HXX
 #define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_WINDOWCOMMANDDISPATCH_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
-
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/lang/XEventListener.hpp>
@@ -47,9 +45,10 @@ namespace framework{
             scenarios. On the other side VCL does not hold us alive (because it doesn't know our UNO reference).
             So we register at the VCL level as an event listener and
  */
-class WindowCommandDispatch : private ThreadHelpBase
+class WindowCommandDispatch
 {
     private:
+        osl::Mutex m_mutex;
 
         /// can be used to create own needed services on demand.
         css::uno::Reference< css::uno::XComponentContext > m_xContext;
commit 3f1d1539f6052d0048feae840074322552cd8e46
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:18:38 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I3df1bcd733637db8d967809e9abb0d2775d58efb

diff --git a/framework/source/inc/dispatch/loaddispatcher.hxx b/framework/source/inc/dispatch/loaddispatcher.hxx
index c0384b2..b8b6666 100644
--- a/framework/source/inc/dispatch/loaddispatcher.hxx
+++ b/framework/source/inc/dispatch/loaddispatcher.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_LOADDISPATCHER_HXX
 
 #include <loadenv/loadenv.hxx>
+#include <threadhelp/threadhelpbase.hxx>
 
 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
diff --git a/framework/source/inc/loadenv/actionlockguard.hxx b/framework/source/inc/loadenv/actionlockguard.hxx
index e399550..589deea 100644
--- a/framework/source/inc/loadenv/actionlockguard.hxx
+++ b/framework/source/inc/loadenv/actionlockguard.hxx
@@ -21,9 +21,6 @@
 #define INCLUDED_FRAMEWORK_SOURCE_INC_LOADENV_ACTIONLOCKGUARD_HXX
 
 
-#include <threadhelp/threadhelpbase.hxx>
-#include <threadhelp/guard.hxx>
-
 #include <com/sun/star/document/XActionLockable.hpp>
 
 
@@ -35,12 +32,13 @@ namespace framework{
     @descr  This guard should be used to be shure, that any lock will be
             released. Otherwise the locaked document can hinder the office on shutdown!
 */
-class ActionLockGuard : private ThreadHelpBase
+class ActionLockGuard
 {
 
     // member
 
     private:
+        osl::Mutex m_mutex;
 
         /** @short  points to the object, which can be locked from outside. */
         css::uno::Reference< css::document::XActionLockable > m_xActionLock;
@@ -62,8 +60,7 @@ class ActionLockGuard : private ThreadHelpBase
                     in a mode "use guard for more then one resources".
          */
         ActionLockGuard()
-            : ThreadHelpBase (         )
-            , m_bActionLocked(sal_False)
+            : m_bActionLocked(sal_False)
         {
         }
 
@@ -74,8 +71,7 @@ class ActionLockGuard : private ThreadHelpBase
                     points to the outside resource, which should be locked.
          */
         ActionLockGuard(const css::uno::Reference< css::document::XActionLockable >& xLock)
-            : ThreadHelpBase (         )
-            , m_bActionLocked(sal_False)
+            : m_bActionLocked(sal_False)
         {
             setResource(xLock);
         }
@@ -103,8 +99,7 @@ class ActionLockGuard : private ThreadHelpBase
          */
         virtual sal_Bool setResource(const css::uno::Reference< css::document::XActionLockable >& xLock)
         {
-            // SAFE -> ..........................
-            Guard aMutexLock(m_aLock);
+            osl::MutexGuard g(m_mutex);
 
             if (m_bActionLocked || !xLock.is())
                 return sal_False;
@@ -112,7 +107,6 @@ class ActionLockGuard : private ThreadHelpBase
             m_xActionLock = xLock;
             m_xActionLock->addActionLock();
             m_bActionLocked = m_xActionLock->isActionLocked();
-            // <- SAFE ..........................
 
             return sal_True;
         }
@@ -132,7 +126,7 @@ class ActionLockGuard : private ThreadHelpBase
         virtual void freeResource()
         {
             // SAFE -> ..........................
-            Guard aMutexLock(m_aLock);
+            osl::ClearableMutexGuard aMutexLock(m_mutex);
 
             css::uno::Reference< css::document::XActionLockable > xLock   = m_xActionLock  ;
             sal_Bool                                              bLocked = m_bActionLocked;
@@ -140,7 +134,7 @@ class ActionLockGuard : private ThreadHelpBase
             m_xActionLock.clear();
             m_bActionLocked = sal_False;
 
-            aMutexLock.unlock();
+            aMutexLock.clear();
             // <- SAFE ..........................
 
             if (bLocked && xLock.is())
@@ -151,24 +145,19 @@ class ActionLockGuard : private ThreadHelpBase
         /** @short  lock the internal wrapped resource, if its not already done. */
         virtual void lock()
         {
-            // SAFE -> ..........................
-            Guard aMutexLock(m_aLock);
-
+            osl::MutexGuard g(m_mutex);
             if (!m_bActionLocked && m_xActionLock.is())
             {
                 m_xActionLock->addActionLock();
                 m_bActionLocked = m_xActionLock->isActionLocked();
             }
-            // <- SAFE ..........................
         }
 
 
         /** @short  unlock the internal wrapped resource, if its not already done. */
         virtual void unlock()
         {
-            // SAFE -> ..........................
-            Guard aMutexLock(m_aLock);
-
+            osl::MutexGuard g(m_mutex);
             if (m_bActionLocked && m_xActionLock.is())
             {
                 m_xActionLock->removeActionLock();
@@ -176,7 +165,6 @@ class ActionLockGuard : private ThreadHelpBase
                 // May another guard use the same lock object :-(
                 m_bActionLocked = sal_False;
             }
-            // <- SAFE ..........................
         }
 };
 
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 577f23d..6a5090b 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -32,6 +32,7 @@
 #include <dispatch/dispatchinformationprovider.hxx>
 #include <classes/framecontainer.hxx>
 #include <classes/propertysethelper.hxx>
+#include <threadhelp/guard.hxx>
 #include <threadhelp/transactionguard.hxx>
 #include <threadhelp/transactionbase.hxx>
 #include <general.h>
commit 9baa3cf73e5458c2664f030de33b97828bd551c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:13:44 2014 +0100

    Use an osl::Mutex directly
    
    Change-Id: I22d6d17bbd6886733df645e4d217c6fd1d995929

diff --git a/framework/inc/jobs/helponstartup.hxx b/framework/inc/jobs/helponstartup.hxx
index e30d1a4..2eb88e4 100644
--- a/framework/inc/jobs/helponstartup.hxx
+++ b/framework/inc/jobs/helponstartup.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
 #define INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <macros/xserviceinfo.hxx>
@@ -45,13 +44,12 @@ namespace framework{
 
     @author as96863
  */
-class HelpOnStartup : private ThreadHelpBase
-                      ,public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XEventListener,::com::sun::star::task::XJob >
+class HelpOnStartup : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XEventListener,::com::sun::star::task::XJob >
 {
 
     // member
     private:
-
+        osl::Mutex m_mutex;
 
         /** @short  reference to an uno service manager. */
         css::uno::Reference< css::uno::XComponentContext > m_xContext;
diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx
index 95f90c4..a18b1a3 100644
--- a/framework/source/jobs/helponstartup.cxx
+++ b/framework/source/jobs/helponstartup.cxx
@@ -21,7 +21,6 @@
 
 // include own header
 #include <jobs/helponstartup.hxx>
-#include <threadhelp/guard.hxx>
 #include <loadenv/targethelper.hxx>
 #include <services.h>
 
@@ -101,8 +100,7 @@ DEFINE_INIT_SERVICE(HelpOnStartup,
 
 
 HelpOnStartup::HelpOnStartup(const css::uno::Reference< css::uno::XComponentContext >& xContext)
-    : ThreadHelpBase(     )
-    , m_xContext    (xContext)
+    : m_xContext    (xContext)
 {
 }
 
@@ -163,18 +161,13 @@ css::uno::Any SAL_CALL HelpOnStartup::execute(const css::uno::Sequence< css::bea
 void SAL_CALL HelpOnStartup::disposing(const css::lang::EventObject& aEvent)
     throw(css::uno::RuntimeException, std::exception)
 {
-    // SAFE ->
-    Guard aLock(m_aLock);
-
+    osl::MutexGuard g(m_mutex);
     if (aEvent.Source == m_xModuleManager)
         m_xModuleManager.clear();
     else if (aEvent.Source == m_xDesktop)
         m_xDesktop.clear();
     else if (aEvent.Source == m_xConfig)
         m_xConfig.clear();
-
-    aLock.unlock();
-    // <- SAFE
 }
 
 
@@ -211,9 +204,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::be
     // OK - now we are sure this document is a top level document.
     // Classify it.
     // SAFE ->
-    Guard aLock(m_aLock);
+    osl::ClearableMutexGuard aLock(m_mutex);
     css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = m_xModuleManager;
-    aLock.unlock();
+    aLock.clear();
     // <- SAFE
 
     OUString sModuleId;
@@ -233,9 +226,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::be
 OUString HelpOnStartup::its_getCurrentHelpURL()
 {
     // SAFE ->
-    Guard aLock(m_aLock);
+    osl::ClearableMutexGuard aLock(m_mutex);
     css::uno::Reference< css::frame::XDesktop2 > xDesktop = m_xDesktop;
-    aLock.unlock();
+    aLock.clear();
     // <- SAFE
 
     if (!xDesktop.is())
@@ -278,11 +271,11 @@ OUString HelpOnStartup::its_getCurrentHelpURL()
         return sal_False;
 
     // SAFE ->
-    Guard aLock(m_aLock);
+    osl::ClearableMutexGuard aLock(m_mutex);
     css::uno::Reference< css::container::XNameAccess >     xConfig = m_xConfig;
     OUString                                        sLocale = m_sLocale;
     OUString                                        sSystem = m_sSystem;
-    aLock.unlock();
+    aLock.clear();
     // <- SAFE
 
     if (!xConfig.is())
@@ -322,11 +315,11 @@ OUString HelpOnStartup::its_getCurrentHelpURL()
 OUString HelpOnStartup::its_checkIfHelpEnabledAndGetURL(const OUString& sModule)
 {
     // SAFE ->
-    Guard aLock(m_aLock);
+    osl::ClearableMutexGuard aLock(m_mutex);
     css::uno::Reference< css::container::XNameAccess > xConfig = m_xConfig;
     OUString                                    sLocale = m_sLocale;
     OUString                                    sSystem = m_sSystem;
-    aLock.unlock();
+    aLock.clear();
     // <- SAFE
 
     OUString sHelpURL;
commit 3a94a46fc2cba33fd7d735bbcd62692f1e51183a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 20 11:10:57 2014 +0100

    Access safe members directly
    
    Change-Id: I8d145fcf3dbcb2436392ee01740255a460c610a6

diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx
index 8d051ff..1a7870f 100644
--- a/framework/inc/jobs/shelljob.hxx
+++ b/framework/inc/jobs/shelljob.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_JOBS_SHELLJOB_HXX
 #define INCLUDED_FRAMEWORK_INC_JOBS_SHELLJOB_HXX
 
-#include <threadhelp/threadhelpbase.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <macros/xserviceinfo.hxx>
@@ -49,8 +48,7 @@ namespace framework{
 
     @author as96863
  */
-class ShellJob : private ThreadHelpBase
-               ,public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,::com::sun::star::task::XJob >
+class ShellJob : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,::com::sun::star::task::XJob >
 {
 
     // member
diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx
index 8a63290..997ce06 100644
--- a/framework/source/jobs/shelljob.cxx
+++ b/framework/source/jobs/shelljob.cxx
@@ -23,7 +23,6 @@
 
 #include <jobs/shelljob.hxx>
 #include <jobs/jobconst.hxx>
-#include <threadhelp/guard.hxx>
 #include <services.h>
 
 
@@ -80,8 +79,7 @@ DEFINE_INIT_SERVICE(ShellJob,
 
 
 ShellJob::ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext)
-    : ThreadHelpBase(     )
-    , m_xContext    (xContext)
+    : m_xContext    (xContext)
 {
 }
 
@@ -141,15 +139,9 @@ css::uno::Any ShellJob::impl_generateAnswer4Deactivation()
 
 OUString ShellJob::impl_substituteCommandVariables(const OUString& sCommand)
 {
-    // SYNCHRONIZED ->
-    Guard aReadLock(m_aLock);
-    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
-    aReadLock.unlock();
-    // <- SYNCHRONIZED
-
     try
     {
-        css::uno::Reference< css::util::XStringSubstitution > xSubst(  css::util::PathSubstitution::create(xContext) );
+        css::uno::Reference< css::util::XStringSubstitution > xSubst(  css::util::PathSubstitution::create(m_xContext) );
         const ::sal_Bool                                      bSubstRequired   = sal_True;
         const OUString                                 sCompleteCommand = xSubst->substituteVariables(sCommand, bSubstRequired);
 


More information about the Libreoffice-commits mailing list