diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 16:10:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 20:46:19 +0200 |
commit | bc66bf4608557d757555aef1f46abf8a15c3538b (patch) | |
tree | 92d1f64c49ad464c26cb33b0044fdf54efa7cdf5 /desktop/source/deployment/gui/dp_gui_extlistbox.cxx | |
parent | d72f963c0de0c2e48f1dc999cd8687e13a1f676f (diff) |
loplugin:flatten in desktop
Change-Id: I1ab39e041025692cac06eb6602787f16a3a9cb0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92198
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source/deployment/gui/dp_gui_extlistbox.cxx')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 4ccac79a4f24..3e0ca1a7ab9c 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -978,52 +978,52 @@ void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage //is in the disposing state and all calls on it may result in a DisposedException. void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage > &xPackage ) { - if ( ! m_bInDelete ) - { - bool invalidate = false; - { - ::osl::ClearableMutexGuard aGuard( m_entriesMutex ); + if ( m_bInDelete ) + return; - auto iIndex = std::find_if(m_vEntries.begin(), m_vEntries.end(), - [&xPackage](const TEntry_Impl& rxEntry) { return rxEntry->m_xPackage == xPackage; }); - if (iIndex != m_vEntries.end()) - { - long nPos = iIndex - m_vEntries.begin(); + bool invalidate = false; + { + ::osl::ClearableMutexGuard aGuard( m_entriesMutex ); - // Entries mustn't be removed here, because they contain a hyperlink control - // which can only be deleted when the thread has the solar mutex. Therefore - // the entry will be moved into the m_vRemovedEntries list which will be - // cleared on the next paint event - m_vRemovedEntries.push_back( *iIndex ); - (*iIndex)->m_xPackage->removeEventListener(m_xRemoveListener.get()); - m_vEntries.erase( iIndex ); + auto iIndex = std::find_if(m_vEntries.begin(), m_vEntries.end(), + [&xPackage](const TEntry_Impl& rxEntry) { return rxEntry->m_xPackage == xPackage; }); + if (iIndex != m_vEntries.end()) + { + long nPos = iIndex - m_vEntries.begin(); - m_bNeedsRecalc = true; + // Entries mustn't be removed here, because they contain a hyperlink control + // which can only be deleted when the thread has the solar mutex. Therefore + // the entry will be moved into the m_vRemovedEntries list which will be + // cleared on the next paint event + m_vRemovedEntries.push_back( *iIndex ); + (*iIndex)->m_xPackage->removeEventListener(m_xRemoveListener.get()); + m_vEntries.erase( iIndex ); - if ( IsReallyVisible() ) - invalidate = true; + m_bNeedsRecalc = true; - if ( m_bHasActive ) - { - if ( nPos < m_nActive ) - m_nActive -= 1; - else if ( ( nPos == m_nActive ) && - ( nPos == static_cast<long>(m_vEntries.size()) ) ) - m_nActive -= 1; + if ( IsReallyVisible() ) + invalidate = true; - m_bHasActive = false; - //clear before calling out of this method - aGuard.clear(); - selectEntry( m_nActive ); - } + if ( m_bHasActive ) + { + if ( nPos < m_nActive ) + m_nActive -= 1; + else if ( ( nPos == m_nActive ) && + ( nPos == static_cast<long>(m_vEntries.size()) ) ) + m_nActive -= 1; + + m_bHasActive = false; + //clear before calling out of this method + aGuard.clear(); + selectEntry( m_nActive ); } } + } - if (invalidate) - { - SolarMutexGuard g; - Invalidate(); - } + if (invalidate) + { + SolarMutexGuard g; + Invalidate(); } } |