summaryrefslogtreecommitdiff
path: root/framework/source/uielement
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 12:31:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 14:58:51 +0200
commit29489b33b435683021b72cb2bce27aba8cb7a430 (patch)
tree8e4e1c59d56d5ed0d0ca4d088419067041e4553a /framework/source/uielement
parenta4244c0f05b95ded277a3a7ed217bf0451daa996 (diff)
loplugin:flatten
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uielement')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx60
1 files changed, 30 insertions, 30 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 857d797bd542..ddec6fb528d7 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1758,26 +1758,26 @@ void ToolBarManager::HandleClick(ClickAction eClickAction)
ToolBoxItemId nId( m_pImpl->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
- if ( pIter != m_aControllerMap.end() )
- {
- Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
+ if ( pIter == m_aControllerMap.end() )
+ return;
- if ( xController.is() )
+ Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
+
+ if ( xController.is() )
+ {
+ switch (eClickAction)
{
- switch (eClickAction)
- {
- case ClickAction::Click:
- xController->click();
- break;
+ case ClickAction::Click:
+ xController->click();
+ break;
- case ClickAction::DblClick:
- xController->doubleClick();
- break;
+ case ClickAction::DblClick:
+ xController->doubleClick();
+ break;
- case ClickAction::Execute:
- xController->execute(0);
- break;
- }
+ case ClickAction::Execute:
+ xController->execute(0);
+ break;
}
}
}
@@ -1804,22 +1804,22 @@ void ToolBarManager::OnDropdownClick(bool bCreatePopupWindow)
ToolBoxItemId nId( m_pImpl->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
- if ( pIter != m_aControllerMap.end() )
- {
- Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
+ if ( pIter == m_aControllerMap.end() )
+ return;
- if ( xController.is() )
+ Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
+
+ if ( xController.is() )
+ {
+ if (bCreatePopupWindow)
{
- if (bCreatePopupWindow)
- {
- Reference< XWindow > xWin = xController->createPopupWindow();
- if ( xWin.is() )
- xWin->setFocus();
- }
- else
- {
- xController->click();
- }
+ Reference< XWindow > xWin = xController->createPopupWindow();
+ if ( xWin.is() )
+ xWin->setFocus();
+ }
+ else
+ {
+ xController->click();
}
}
}