summaryrefslogtreecommitdiff
path: root/framework/source/uielement/popuptoolbarcontroller.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-07 20:32:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-08 11:01:31 +0200
commitff25a4a6f4b9763b09abbbd6a711fa4d18f40ade (patch)
treeded29238e8fb782c20b429f6d5df6c40a3bb2604 /framework/source/uielement/popuptoolbarcontroller.cxx
parent32343bcbb786168df62f85a57e30c620c3d3bdb4 (diff)
loplugin:flatten in framework
Change-Id: I2a74a7543b5edd853396efa31a3e2568e6607778 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uielement/popuptoolbarcontroller.cxx')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 9520ae8fc5d7..5c11600c31b9 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -355,28 +355,28 @@ void GenericPopupToolbarController::statusChanged( const css::frame::FeatureStat
void GenericPopupToolbarController::functionExecuted( const OUString& rCommand )
{
- if ( m_bReplaceWithLast )
- {
- removeStatusListener( m_aCommandURL );
+ if ( !m_bReplaceWithLast )
+ return;
- auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommand, m_sModuleName);
- OUString aRealCommand( vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties) );
- m_aCommandURL = aRealCommand.isEmpty() ? rCommand : aRealCommand;
- addStatusListener( m_aCommandURL );
+ removeStatusListener( m_aCommandURL );
- ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
- if ( getToolboxId( nId, &pToolBox ) )
- {
- pToolBox->SetItemCommand( nId, rCommand );
- pToolBox->SetHelpText( nId, OUString() ); // Will retrieve the new one from help.
- pToolBox->SetItemText(nId, vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
- pToolBox->SetQuickHelpText(nId, vcl::CommandInfoProvider::GetTooltipForCommand(rCommand, aProperties, m_xFrame));
-
- Image aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommand, m_xFrame, pToolBox->GetImageSize());
- if ( !!aImage )
- pToolBox->SetItemImage( nId, aImage );
- }
+ auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommand, m_sModuleName);
+ OUString aRealCommand( vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties) );
+ m_aCommandURL = aRealCommand.isEmpty() ? rCommand : aRealCommand;
+ addStatusListener( m_aCommandURL );
+
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nId = 0;
+ if ( getToolboxId( nId, &pToolBox ) )
+ {
+ pToolBox->SetItemCommand( nId, rCommand );
+ pToolBox->SetHelpText( nId, OUString() ); // Will retrieve the new one from help.
+ pToolBox->SetItemText(nId, vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
+ pToolBox->SetQuickHelpText(nId, vcl::CommandInfoProvider::GetTooltipForCommand(rCommand, aProperties, m_xFrame));
+
+ Image aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommand, m_xFrame, pToolBox->GetImageSize());
+ if ( !!aImage )
+ pToolBox->SetItemImage( nId, aImage );
}
}