diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-25 11:21:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-26 16:46:55 +0100 |
commit | b509d72a79a8c64d03ea8f91c69c58a24e0b2dc7 (patch) | |
tree | 97770ab005aac451b4c34a1fae562a3d579adb1f /cui/source/customize | |
parent | ea31d3cc8566eeb9d3dbf55b385d8c619daaddf9 (diff) |
tdf#126043 fetch the command properties just once
Change-Id: Iaf343e9858be36ca8772d9c12eee772d93b4c394
Reviewed-on: https://gerrit.libreoffice.org/83668
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/83763
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/CommandCategoryListBox.cxx | 8 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx index 10758d0af47a..7576d0771edc 100644 --- a/cui/source/customize/CommandCategoryListBox.cxx +++ b/cui/source/customize/CommandCategoryListBox.cxx @@ -216,11 +216,13 @@ void CommandCategoryListBox::FillFunctionsList( for (const auto & rInfo : xCommands) { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rInfo.Command, m_sModuleLongName); + OUString sUIName = getCommandName(rInfo.Command); - OUString sLabel = vcl::CommandInfoProvider::GetLabelForCommand(rInfo.Command, m_sModuleLongName); - OUString sTooltipLabel = vcl::CommandInfoProvider::GetTooltipForCommand( rInfo.Command, m_xFrame); + OUString sLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); + OUString sTooltipLabel = vcl::CommandInfoProvider::GetTooltipForCommand(rInfo.Command, aProperties, m_xFrame); OUString sPopupLabel = - (vcl::CommandInfoProvider::GetPopupLabelForCommand(rInfo.Command, m_sModuleLongName)) + (vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties)) .replaceFirst("~", ""); // Apply the search filter diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 0d6f668610f6..acb447b1f4f7 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1418,12 +1418,14 @@ int SvxConfigPage::AddFunction(int nTarget, bool bAllowDuplicates) OUString aDisplayName; OUString aModuleId = vcl::CommandInfoProvider::GetModuleIdentifier( m_xFrame ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aURL, aModuleId); + if ( typeid(*pCurrentSaveInData) == typeid(ContextMenuSaveInData) ) - aDisplayName = vcl::CommandInfoProvider::GetPopupLabelForCommand( aURL, aModuleId ); + aDisplayName = vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); else if ( typeid(*pCurrentSaveInData) == typeid(MenuSaveInData) ) - aDisplayName = vcl::CommandInfoProvider::GetMenuLabelForCommand( aURL, aModuleId ); + aDisplayName = vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties); else - aDisplayName = vcl::CommandInfoProvider::GetLabelForCommand( aURL, aModuleId ); + aDisplayName = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); SvxConfigEntry* pNewEntryData = new SvxConfigEntry( aDisplayName, aURL, false, /*bParentData*/false ); |