summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2022-07-28 01:08:31 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2022-08-10 08:24:27 +0200
commit085abe2b7187f2cfd69a5a1c6e84ef0c9c214f78 (patch)
treef42a06aef82b652bc3cc976cefa228bb7f6f3528 /framework/source
parent032bacd44fc1a4a9c55139aa3fc13d988ef3d6a9 (diff)
Unnecessary ToolBox::SetItemText call
Change-Id: I8d15e9657b3a6d01de9d07130ae3aa8284fbd178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138037 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index b2efe27c2f0a..7dbee84c1072 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -216,16 +216,14 @@ public:
}
virtual void InsertItem(ToolBoxItemId nId,
- const OUString& rString,
const OUString& rCommandURL,
const OUString& rTooltip,
const OUString& rLabel,
ToolBoxItemBits nItemBits) override
{
- m_pToolBar->InsertItem( nId, rString, nItemBits );
+ m_pToolBar->InsertItem( nId, rLabel, nItemBits );
m_pToolBar->SetItemCommand( nId, rCommandURL );
m_pToolBar->SetQuickHelpText(nId, rTooltip);
- m_pToolBar->SetItemText( nId, rLabel );
m_pToolBar->EnableItem( nId );
m_pToolBar->SetItemState( nId, TRISTATE_FALSE );
}
@@ -420,7 +418,6 @@ public:
}
virtual void InsertItem(ToolBoxItemId nId,
- const OUString& /*rString*/,
const OUString& rCommandURL,
const OUString& rTooltip,
const OUString& rLabel,
@@ -1410,7 +1407,6 @@ void ToolBarManager::FillToolbarFromContainer( const Reference< XIndexAccess >&
auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, m_aModuleIdentifier);
if (!aProperties.hasElements()) // E.g., user-provided macro command?
aProperties = aProps; // Use existing info, including user-provided Label
- OUString aString(vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( nStyle );
@@ -1418,9 +1414,9 @@ void ToolBarManager::FillToolbarFromContainer( const Reference< XIndexAccess >&
aTooltip = vcl::CommandInfoProvider::GetTooltipForCommand(aCommandURL, aProperties, m_xFrame);
if ( aLabel.isEmpty() )
- aLabel = aString;
+ aLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
- m_pImpl->InsertItem(nId, aString, aCommandURL, aTooltip, aLabel, nItemBits);
+ m_pImpl->InsertItem(nId, aCommandURL, aTooltip, aLabel, nItemBits);
// Fill command map. It stores all our commands and from what
// image manager we got our image. So we can decide if we have to use an