diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 15:11:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 21:46:57 +0200 |
commit | 4f3f61a621a0e66fd0eab4886a3aa51e10513ad3 (patch) | |
tree | 03fa6f0fa067e6d7805cfa95e1c234f7821d4f42 /accessibility/source/standard/vclxaccessiblelistitem.cxx | |
parent | 8d4fd3418322f3f6852054c44be2cd74b0db76ee (diff) |
loplugin:flatten in accessibility
Change-Id: I5e02fe0288845210f1d8e41db0342967858098fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92487
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility/source/standard/vclxaccessiblelistitem.cxx')
-rw-r--r-- | accessibility/source/standard/vclxaccessiblelistitem.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index 6dda80fe0112..90f8656c8858 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -574,22 +574,22 @@ void SAL_CALL VCLXAccessibleListItem::addAccessibleEventListener( const Referenc void SAL_CALL VCLXAccessibleListItem::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) { - if ( xListener.is() && m_nClientId ) + if ( !(xListener.is() && m_nClientId) ) + return; + + sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener ); + if ( nListenerCount ) + return; + + // no listeners anymore + // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), + // and at least to us not firing any events anymore, in case somebody calls + // NotifyAccessibleEvent, again + if ( m_nClientId ) { - sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener ); - if ( !nListenerCount ) - { - // no listeners anymore - // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), - // and at least to us not firing any events anymore, in case somebody calls - // NotifyAccessibleEvent, again - if ( m_nClientId ) - { - comphelper::AccessibleEventNotifier::TClientId nId( m_nClientId ); - m_nClientId = 0; - comphelper::AccessibleEventNotifier::revokeClient( nId ); - } - } + comphelper::AccessibleEventNotifier::TClientId nId( m_nClientId ); + m_nClientId = 0; + comphelper::AccessibleEventNotifier::revokeClient( nId ); } } |