diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 14:08:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 11:01:18 +0200 |
commit | 9df2821e61979dab32390d5c64dd49bee868adbb (patch) | |
tree | 5b827e29e73ac2300c164b0a389a784a358956e6 /chart2/source/controller/accessibility/AccessibleBase.cxx | |
parent | 8b0a69498b025e13d9772689e9e4fa3d6b05e609 (diff) |
loplugin:flatten in chart2
Change-Id: Iadc4da6515a7d82e7a92b33d74d589b61fa2c64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92480
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/accessibility/AccessibleBase.cxx')
-rw-r--r-- | chart2/source/controller/accessibility/AccessibleBase.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index 91040ee70671..6f9192eba064 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -253,24 +253,24 @@ bool AccessibleBase::ImplUpdateChildren() void AccessibleBase::AddChild( AccessibleBase * pChild ) { OSL_ENSURE( pChild != nullptr, "Invalid Child" ); - if( pChild ) - { - ClearableMutexGuard aGuard( m_aMutex ); + if( !pChild ) + return; - Reference< XAccessible > xChild( pChild ); - m_aChildList.push_back( xChild ); + ClearableMutexGuard aGuard( m_aMutex ); - m_aChildOIDMap[ pChild->GetId() ] = xChild; + Reference< XAccessible > xChild( pChild ); + m_aChildList.push_back( xChild ); - // inform listeners of new child - if( m_bChildrenInitialized ) - { - Any aEmpty, aNew; - aNew <<= xChild; + m_aChildOIDMap[ pChild->GetId() ] = xChild; - aGuard.clear(); - BroadcastAccEvent( AccessibleEventId::CHILD, aNew, aEmpty ); - } + // inform listeners of new child + if( m_bChildrenInitialized ) + { + Any aEmpty, aNew; + aNew <<= xChild; + + aGuard.clear(); + BroadcastAccEvent( AccessibleEventId::CHILD, aNew, aEmpty ); } } @@ -282,41 +282,41 @@ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId ) ClearableMutexGuard aGuard( m_aMutex ); ChildOIDMap::iterator aIt( m_aChildOIDMap.find( rOId )); - if( aIt != m_aChildOIDMap.end()) - { - Reference< XAccessible > xChild( aIt->second ); + if( aIt == m_aChildOIDMap.end()) + return; - // remove from map - m_aChildOIDMap.erase( aIt ); + Reference< XAccessible > xChild( aIt->second ); - // search child in vector - ChildListVectorType::iterator aVecIter = - std::find( m_aChildList.begin(), m_aChildList.end(), xChild ); + // remove from map + m_aChildOIDMap.erase( aIt ); - OSL_ENSURE( aVecIter != m_aChildList.end(), - "Inconsistent ChildMap" ); + // search child in vector + ChildListVectorType::iterator aVecIter = + std::find( m_aChildList.begin(), m_aChildList.end(), xChild ); - // remove child from vector - m_aChildList.erase( aVecIter ); - bool bInitialized = m_bChildrenInitialized; + OSL_ENSURE( aVecIter != m_aChildList.end(), + "Inconsistent ChildMap" ); - // call listeners unguarded - aGuard.clear(); + // remove child from vector + m_aChildList.erase( aVecIter ); + bool bInitialized = m_bChildrenInitialized; - // inform listeners of removed child - if( bInitialized ) - { - Any aEmpty, aOld; - aOld <<= xChild; + // call listeners unguarded + aGuard.clear(); - BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld ); - } + // inform listeners of removed child + if( bInitialized ) + { + Any aEmpty, aOld; + aOld <<= xChild; - // dispose the child - Reference< lang::XComponent > xComp( xChild, UNO_QUERY ); - if( xComp.is()) - xComp->dispose(); + BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld ); } + + // dispose the child + Reference< lang::XComponent > xComp( xChild, UNO_QUERY ); + if( xComp.is()) + xComp->dispose(); } awt::Point AccessibleBase::GetUpperLeftOnScreen() const |