diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-06-07 10:11:29 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-06-07 10:11:29 +0000 |
commit | d6015b89e2c155ba93538b15864b7c6f48b9f1e8 (patch) | |
tree | 5188daea21d21001fa87396196c330bf2dac20c2 /cppuhelper/source/implbase.cxx | |
parent | bfc5da2da9df0a0809fc9b77a4a926b21d3d6704 (diff) |
#87052# no STL exports from cppuhelper lib
Diffstat (limited to 'cppuhelper/source/implbase.cxx')
-rw-r--r-- | cppuhelper/source/implbase.cxx | 72 |
1 files changed, 60 insertions, 12 deletions
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index 0ccc9a79bbb6..bc58853b07bb 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:53 $ + * last change: $Author: dbo $ $Date: 2001-06-07 11:11:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -285,7 +285,14 @@ void WeakComponentImplHelperBase::release() { if (1 == m_refCount && !rBHelper.bDisposed) { - dispose(); + try + { + dispose(); + } + catch (...) + { + OSL_ENSURE( 0, "### unexpected exception caught!" ); + } } OWeakObject::release(); } @@ -298,9 +305,18 @@ void WeakComponentImplHelperBase::dispose() { rBHelper.bInDispose = sal_True; aGuard.clear(); - lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); - rBHelper.aLC.disposeAndClear( aEvt ); - disposing(); + try + { + lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); + rBHelper.aLC.disposeAndClear( aEvt ); + disposing(); + } + catch (...) + { + rBHelper.bDisposed = sal_True; + rBHelper.bInDispose = sal_False; + throw; + } rBHelper.bDisposed = sal_True; rBHelper.bInDispose = sal_False; } @@ -310,7 +326,15 @@ void WeakComponentImplHelperBase::addEventListener( Reference< lang::XEventListener > const & xListener ) throw (RuntimeException) { - rBHelper.addListener( ::getCppuType( &xListener ), xListener ); + if (rBHelper.bDisposed || rBHelper.bInDispose) + { + lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); + xListener->disposing( aEvt ); + } + else + { + rBHelper.addListener( ::getCppuType( &xListener ), xListener ); + } } //__________________________________________________________________________________________________ void WeakComponentImplHelperBase::removeEventListener( @@ -366,7 +390,14 @@ void WeakAggComponentImplHelperBase::release() Reference< XInterface > x( xDelegator ); if (!x.is() && 1 == m_refCount && !rBHelper.bDisposed) { - dispose(); + try + { + dispose(); + } + catch (...) + { + OSL_ENSURE( 0, "### unexpected exception caught!" ); + } } OWeakAggObject::release(); } @@ -379,9 +410,18 @@ void WeakAggComponentImplHelperBase::dispose() { rBHelper.bInDispose = sal_True; aGuard.clear(); - lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); - rBHelper.aLC.disposeAndClear( aEvt ); - disposing(); + try + { + lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); + rBHelper.aLC.disposeAndClear( aEvt ); + disposing(); + } + catch (...) + { + rBHelper.bDisposed = sal_True; + rBHelper.bInDispose = sal_False; + throw; + } rBHelper.bDisposed = sal_True; rBHelper.bInDispose = sal_False; } @@ -391,7 +431,15 @@ void WeakAggComponentImplHelperBase::addEventListener( Reference< lang::XEventListener > const & xListener ) throw (RuntimeException) { - rBHelper.addListener( ::getCppuType( &xListener ), xListener ); + if (rBHelper.bDisposed || rBHelper.bInDispose) + { + lang::EventObject aEvt( static_cast< OWeakObject * >( this ) ); + xListener->disposing( aEvt ); + } + else + { + rBHelper.addListener( ::getCppuType( &xListener ), xListener ); + } } //__________________________________________________________________________________________________ void WeakAggComponentImplHelperBase::removeEventListener( |