diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 14:42:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 15:27:07 +0100 |
commit | 8030fe25724bd995a6902610614ba05ed6cfb643 (patch) | |
tree | 9349aee6826ad3e0d327dba48bd2cc82b63961b6 /framework | |
parent | 4eb2c58093123262ee2366898c7ab779db985948 (diff) |
Use SolarMutexGuard directly
Change-Id: Ie13cf612b2f9b15698a84d35d420b0b7c0009e1b
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/helper/ocomponentenumeration.hxx | 7 | ||||
-rw-r--r-- | framework/source/helper/ocomponentenumeration.cxx | 21 |
2 files changed, 6 insertions, 22 deletions
diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx index 1b397f050578..710a3820150d 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 e7e1eaa86add..2f3057c8d137 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 ) |