summaryrefslogtreecommitdiff
path: root/framework
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
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')
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx1
-rw-r--r--framework/source/uielement/toolbarmanager.cxx10
2 files changed, 3 insertions, 8 deletions
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 2e7cd1c01a9a..162e14aca4e3 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -65,7 +65,6 @@ public:
virtual void Destroy() = 0;
virtual css::uno::Reference<css::awt::XWindow> GetInterface() = 0;
virtual void InsertItem(ToolBoxItemId nId,
- const OUString& rString,
const OUString& rCommandURL,
const OUString& rTooltip,
const OUString& rLabel,
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