Kaydet (Commit) a9a04f11 authored tarafından Noel Grandin's avatar Noel Grandin

convert ComponentMethodGuard::MethodType to scoped enum

Change-Id: I1f1b4981c70c2b8ff8087a85f0af28b816b4654a
üst cd1bbdf0
...@@ -321,7 +321,7 @@ namespace comphelper ...@@ -321,7 +321,7 @@ namespace comphelper
void SAL_CALL EnumerableMap::initialize( const Sequence< Any >& _arguments ) throw (Exception, RuntimeException, std::exception) void SAL_CALL EnumerableMap::initialize( const Sequence< Any >& _arguments ) throw (Exception, RuntimeException, std::exception)
{ {
ComponentMethodGuard aGuard( *this, ComponentMethodGuard::WithoutInit ); ComponentMethodGuard aGuard( *this, ComponentMethodGuard::MethodType::WithoutInit );
if ( impl_isInitialized_nothrow() ) if ( impl_isInitialized_nothrow() )
throw AlreadyInitializedException(); throw AlreadyInitializedException();
......
...@@ -110,7 +110,7 @@ namespace comphelper ...@@ -110,7 +110,7 @@ namespace comphelper
class ComponentMethodGuard class ComponentMethodGuard
{ {
public: public:
enum MethodType enum class MethodType
{ {
/// allow the method to be called only when being initialized and not being disposed /// allow the method to be called only when being initialized and not being disposed
Default, Default,
...@@ -119,10 +119,10 @@ namespace comphelper ...@@ -119,10 +119,10 @@ namespace comphelper
}; };
ComponentMethodGuard( ComponentBase& _rComponent, const MethodType _eType = Default ) ComponentMethodGuard( ComponentBase& _rComponent, const MethodType _eType = MethodType::Default )
:m_aMutexGuard( _rComponent.getMutex( ComponentBase::GuardAccess() ) ) :m_aMutexGuard( _rComponent.getMutex( ComponentBase::GuardAccess() ) )
{ {
if ( _eType != WithoutInit ) if ( _eType != MethodType::WithoutInit )
_rComponent.checkInitialized( ComponentBase::GuardAccess() ); _rComponent.checkInitialized( ComponentBase::GuardAccess() );
_rComponent.checkDisposed( ComponentBase::GuardAccess() ); _rComponent.checkDisposed( ComponentBase::GuardAccess() );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment