diff options
Diffstat (limited to 'cppuhelper/source/weak.cxx')
-rw-r--r-- | cppuhelper/source/weak.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index b518d2526e3b..1901610d40b7 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -481,11 +481,20 @@ WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef) SA WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& rWeakRef) SAL_THROW( () ) { - try + if (this == &rWeakRef) { - if (this != &rWeakRef) + return *this; + } + Reference< XInterface > xInt( rWeakRef.get() ); + return operator = ( xInt ); +} + +WeakReferenceHelper & SAL_CALL +WeakReferenceHelper::operator= (const Reference< XInterface > & xInt) +SAL_THROW( () ) +{ + try { - Reference< XInterface > xInt( rWeakRef.get() ); if (m_pImpl) { if (m_pImpl->m_XWeakConnectionPoint.is()) @@ -502,7 +511,6 @@ WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& r m_pImpl->acquire(); } } - } catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() return *this; } |