diff options
Diffstat (limited to 'toolkit/source/controls/controlmodelcontainerbase.cxx')
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 05b9edb18643..880b25c53a82 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1100,24 +1100,24 @@ void ResourceListener::startListening( // --- SAFE --- } - if ( rResource.is() ) + if ( !rResource.is() ) + return; + + try { - try - { - rResource->addModifyListener( this ); + rResource->addModifyListener( this ); - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - m_bListening = true; - // --- SAFE --- - } - catch (const RuntimeException&) - { - throw; - } - catch (const Exception&) - { - } + // --- SAFE --- + ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); + m_bListening = true; + // --- SAFE --- + } + catch (const RuntimeException&) + { + throw; + } + catch (const Exception&) + { } } @@ -1132,26 +1132,26 @@ void ResourceListener::stopListening() aGuard.clear(); // --- SAFE --- - if ( xModifyBroadcaster.is() ) + if ( !xModifyBroadcaster.is() ) + return; + + try + { + // --- SAFE --- + aGuard.reset(); + m_bListening = false; + m_xResource.clear(); + aGuard.clear(); + // --- SAFE --- + + xModifyBroadcaster->removeModifyListener( this ); + } + catch (const RuntimeException&) + { + throw; + } + catch (const Exception&) { - try - { - // --- SAFE --- - aGuard.reset(); - m_bListening = false; - m_xResource.clear(); - aGuard.clear(); - // --- SAFE --- - - xModifyBroadcaster->removeModifyListener( this ); - } - catch (const RuntimeException&) - { - throw; - } - catch (const Exception&) - { - } } } @@ -1167,19 +1167,19 @@ void SAL_CALL ResourceListener::modified( aGuard.clear(); // --- SAFE --- - if ( xListener.is() ) + if ( !xListener.is() ) + return; + + try + { + xListener->modified( aEvent ); + } + catch (const RuntimeException&) + { + throw; + } + catch (const Exception&) { - try - { - xListener->modified( aEvent ); - } - catch (const RuntimeException&) - { - throw; - } - catch (const Exception&) - { - } } } @@ -1610,20 +1610,20 @@ void ControlContainerBase::addingControl( const Reference< XControl >& _rxContro SolarMutexGuard aGuard; UnoControlContainer::addingControl( _rxControl ); - if ( _rxControl.is() ) + if ( !_rxControl.is() ) + return; + + Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); + if ( xProps.is() ) { - Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); - if ( xProps.is() ) - { - const Sequence< OUString > aNames { - "PositionX", - "PositionY", - "Width", - "Height" - }; - - xProps->addPropertiesChangeListener( aNames, this ); - } + const Sequence< OUString > aNames { + "PositionX", + "PositionY", + "Width", + "Height" + }; + + xProps->addPropertiesChangeListener( aNames, this ); } } |