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/source/helper/ocomponentenumeration.cxx | |
parent | 4eb2c58093123262ee2366898c7ab779db985948 (diff) |
Use SolarMutexGuard directly
Change-Id: Ie13cf612b2f9b15698a84d35d420b0b7c0009e1b
Diffstat (limited to 'framework/source/helper/ocomponentenumeration.cxx')
-rw-r--r-- | framework/source/helper/ocomponentenumeration.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
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 ) |