Tag: cws_dev300_odbmacros3 User: fs Date: 2008-07-23 11:45:15+0000 Modified: dba/dbaccess/source/core/dataaccess/ModelImpl.hxx
Log: #i76128# init-methods are not allowed to be called if we are already initialized File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ModelImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.hxx?r1=1.24.4.1&r2=1.24.4.2 Delta lines: +18 -14 --------------------- --- ModelImpl.hxx 2008-07-23 10:03:31+0000 1.24.4.1 +++ ModelImpl.hxx 2008-07-23 11:45:13+0000 1.24.4.2 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ModelImpl.hxx,v $ - * $Revision: 1.24.4.1 $ + * $Revision: 1.24.4.2 $ * * This file is part of OpenOffice.org. * @@ -593,25 +593,28 @@ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), getThis() ); } - // checks the component is currently in the initialization phase, or already initialized + /** checks the component is currently in the initialization phase, or already initialized. + Throws NotInitializedException if not so. + + only to be called after checkDisposed! + */ inline void checkNotUninitilized() const { - if ( m_pImpl->isInitialized() ) + if ( m_pImpl->isInitialized() || m_pImpl->isInitializing() ) // fine return; - if ( !m_pImpl->isInitializing() ) - // we're not initialized, and not in the initializing phase throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), getThis() ); } - /** checks whether the component currently being initialized, throws a DoubleInitializationException if so + /** checks whether the component currently being initialized, or already initialized, + throws a DoubleInitializationException if so only to be called after checkDisposed! */ - inline void checkNotInitializing() const + inline void checkNotInitialized() const { - if ( m_pImpl->isInitializing() ) + if ( m_pImpl->isInitializing() || m_pImpl->isInitialized() ) throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), getThis() ); } @@ -662,7 +665,9 @@ // a default method DefaultMethod, // a method which is used (externally) during the initialization phase - MethodUsedDuringInit + MethodUsedDuringInit, + // a method which does not need initialization - use with care! + MethodWithoutInit }; /** constructs the guard @@ -674,9 +679,7 @@ If the given component is already disposed @throws ::com::sun::star::frame::DoubleInitializationException - if _eType is InitMethod, and the given component is already being initialized. The exception - is not thrown if the component already *is* initialized - this is allowed, it will simply - be initialized a second time, perhaps from other resources. + if _eType is InitMethod, and the given component is already initialized, or currently being initialized. @throws ::com::sun::star::lang::NotInitializedException if _eType is DefaultMethod, and the given component is not yet initialized; or if _eType @@ -690,9 +693,10 @@ switch ( _eType ) { - case InitMethod: _component.checkNotInitializing(); break; + case InitMethod: _component.checkNotInitialized(); break; case DefaultMethod: _component.checkInitialized(); break; case MethodUsedDuringInit: _component.checkNotUninitilized(); break; + case MethodWithoutInit: break; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
