diff options
Diffstat (limited to 'stoc/source/servicemanager/servicemanager.cxx')
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 39ea85c5a833..d6eac9b1ccf0 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -316,20 +316,20 @@ public: void OServiceManager_Listener::disposing(const EventObject & rEvt ) { Reference<XSet > x( xSMgr ); - if( x.is() ) + if( !x.is() ) + return; + + try { - try - { - x->remove( Any( &rEvt.Source, cppu::UnoType<XInterface>::get()) ); - } - catch( const IllegalArgumentException & ) - { - OSL_FAIL( "IllegalArgumentException caught" ); - } - catch( const NoSuchElementException & ) - { - OSL_FAIL( "NoSuchElementException caught" ); - } + x->remove( Any( &rEvt.Source, cppu::UnoType<XInterface>::get()) ); + } + catch( const IllegalArgumentException & ) + { + OSL_FAIL( "IllegalArgumentException caught" ); + } + catch( const NoSuchElementException & ) + { + OSL_FAIL( "NoSuchElementException caught" ); } } @@ -1161,24 +1161,24 @@ void OServiceManager::remove( const Any & Element ) //remove from the service map Reference<XServiceInfo > xSF( Reference<XServiceInfo >::query( xEle ) ); - if( xSF.is() ) + if( !xSF.is() ) + return; + + Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames(); + const OUString * pArray = aServiceNames.getConstArray(); + for( sal_Int32 i = 0; i < aServiceNames.getLength(); i++ ) { - Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames(); - const OUString * pArray = aServiceNames.getConstArray(); - for( sal_Int32 i = 0; i < aServiceNames.getLength(); i++ ) - { - pair<HashMultimap_OWString_Interface::iterator, HashMultimap_OWString_Interface::iterator> p = - m_ServiceMap.equal_range( pArray[i] ); + pair<HashMultimap_OWString_Interface::iterator, HashMultimap_OWString_Interface::iterator> p = + m_ServiceMap.equal_range( pArray[i] ); - while( p.first != p.second ) + while( p.first != p.second ) + { + if( xEle == (*p.first).second ) { - if( xEle == (*p.first).second ) - { - m_ServiceMap.erase( p.first ); - break; - } - ++p.first; + m_ServiceMap.erase( p.first ); + break; } + ++p.first; } } } |