diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 11:29:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 12:47:53 +0200 |
commit | a814825461b1fc26288655535b64fc38b18ecf15 (patch) | |
tree | 47f3bad69292d3587bca73f6cdcd838b182d82cb /svx/source/accessibility/GraphCtlAccessibleContext.cxx | |
parent | 1de2b0d3234462b488db54d36ebc17e2b579b0f0 (diff) |
loplugin:flatten in svx/accessibility
Change-Id: Id2c82625fc5cf0d139ea77489578bfce7abc3fa2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100206
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/accessibility/GraphCtlAccessibleContext.cxx')
-rw-r--r-- | svx/source/accessibility/GraphCtlAccessibleContext.cxx | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 8d0c4dfc028a..5ef5801e90c1 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -445,20 +445,20 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::addAccessibleEventListener( const R void SAL_CALL SvxGraphCtrlAccessibleContext::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) { - if (xListener.is()) - { - ::SolarMutexGuard aGuard; + if (!xListener.is()) + return; - sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, 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 - comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); - mnClientId = 0; - } + ::SolarMutexGuard aGuard; + + sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, 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 + comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); + mnClientId = 0; } } @@ -598,25 +598,25 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32 checkChildIndexOnSelection( nIndex ); - if( mpView ) - { - const SdrMarkList& rList = mpView->GetMarkedObjectList(); + if( !mpView ) + return; - SdrObject* pObj = getSdrObject( nIndex ); - if( pObj ) - { - SdrMarkList aRefList( rList ); + const SdrMarkList& rList = mpView->GetMarkedObjectList(); - SdrPageView* pPV = mpView->GetSdrPageView(); - mpView->UnmarkAllObj( pPV ); + SdrObject* pObj = getSdrObject( nIndex ); + if( !pObj ) + return; - const size_t nCount = aRefList.GetMarkCount(); - for( size_t nMark = 0; nMark < nCount; ++nMark ) - { - if( aRefList.GetMark(nMark)->GetMarkedSdrObj() != pObj ) - mpView->MarkObj( aRefList.GetMark(nMark)->GetMarkedSdrObj(), pPV ); - } - } + SdrMarkList aRefList( rList ); + + SdrPageView* pPV = mpView->GetSdrPageView(); + mpView->UnmarkAllObj( pPV ); + + const size_t nCount = aRefList.GetMarkCount(); + for( size_t nMark = 0; nMark < nCount; ++nMark ) + { + if( aRefList.GetMark(nMark)->GetMarkedSdrObj() != pObj ) + mpView->MarkObj( aRefList.GetMark(nMark)->GetMarkedSdrObj(), pPV ); } } |