diff options
29 files changed, 164 insertions, 98 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 ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 77638fa3f798..9e3f52215737 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -193,8 +193,10 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo m_aBorder->SetBorderStyle(WindowBorderStyle::MONO); m_aTBPreview->SetOutStyle(TOOLBOX_STYLE_FLAT); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:DBDisablePreview", + "com.sun.star.sdb.OfficeDatabaseDocument"); m_aTBPreview->InsertItem(SID_DB_APP_DISABLE_PREVIEW, - vcl::CommandInfoProvider::GetLabelForCommand(".uno:DBDisablePreview", "com.sun.star.sdb.OfficeDatabaseDocument"), + vcl::CommandInfoProvider::GetLabelForCommand(aProperties), ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWNONLY|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK); m_aTBPreview->SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview->SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); @@ -974,7 +976,8 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) break; } - OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand(aCommand, "com.sun.star.sdb.OfficeDatabaseDocument"); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, "com.sun.star.sdb.OfficeDatabaseDocument"); + OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, stripTrailingDots(aCommandLabel)); Resize(); diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 85bba326a054..1a86e465b3c9 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -111,7 +111,8 @@ namespace dbaui m_sModule = OUString::createFromAscii( _pAsciiModuleName ); // our label should equal the UI text of the "Open" command - OUString sLabel(vcl::CommandInfoProvider::GetLabelForCommand(".uno:Open", m_sModule)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:Open", m_sModule); + OUString sLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); m_xControl->set_label(" " + sLabel.replaceAll("~", "")); // Place icon left of text and both centered in the button. diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index f72cc3193dfd..5acd1139e217 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -286,8 +286,9 @@ namespace frm { OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) ); m_pToolbar->SetItemCommand( pSupportedFeatures->nId, sCommandURL ); - m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, - vcl::CommandInfoProvider::GetLabelForCommand(sCommandURL, m_sModuleId) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sCommandURL, m_sModuleId); + m_pToolbar->SetQuickHelpText(pSupportedFeatures->nId, + vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); } if ( pSupportedFeatures->bItemWindow ) diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 68932229c692..c9beceba63f7 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -79,7 +79,8 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > cons // insert basic OUString aCommand(".uno:MacroDialog"); - OUString aDisplayName = vcl::CommandInfoProvider::GetMenuLabelForCommand(aCommand, m_aModuleName); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, m_aModuleName); + OUString aDisplayName = vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties); pPopupMenu->InsertItem( 2, aDisplayName ); pPopupMenu->SetItemCommand( 2, aCommand ); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 2dbb5f9950ce..f7a41c75f9e3 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -947,12 +947,13 @@ bool MenuBarManager::MustBeHidden( PopupMenu* pPopupMenu, const Reference< XURLT OUString MenuBarManager::RetrieveLabelFromCommand(const OUString& rCmdURL) { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCmdURL, m_aModuleIdentifier); if ( !m_bHasMenuBar ) { // This is a context menu, prefer "PopupLabel" over "Label". - return vcl::CommandInfoProvider::GetPopupLabelForCommand(rCmdURL, m_aModuleIdentifier); + return vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); } - return vcl::CommandInfoProvider::GetMenuLabelForCommand(rCmdURL, m_aModuleIdentifier); + return vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties); } bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHandler ) @@ -1047,7 +1048,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF } // Command can be just an alias to another command. - OUString aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( aItemCommand, m_aModuleIdentifier ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aItemCommand, m_aModuleIdentifier); + OUString aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); if ( !aRealCommand.isEmpty() ) aItemCommand = aRealCommand; diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 63a048604d76..27d95652c217 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -360,7 +360,8 @@ void GenericPopupToolbarController::functionExecuted( const OUString& rCommand ) { removeStatusListener( m_aCommandURL ); - OUString aRealCommand( vcl::CommandInfoProvider::GetRealCommandForCommand( rCommand, m_sModuleName ) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommand, m_sModuleName); + OUString aRealCommand( vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties) ); m_aCommandURL = aRealCommand.isEmpty() ? rCommand : aRealCommand; addStatusListener( m_aCommandURL ); @@ -370,8 +371,8 @@ void GenericPopupToolbarController::functionExecuted( const OUString& rCommand ) { pToolBox->SetItemCommand( nId, rCommand ); pToolBox->SetHelpText( nId, OUString() ); // Will retrieve the new one from help. - pToolBox->SetItemText( nId, vcl::CommandInfoProvider::GetLabelForCommand( rCommand, m_sModuleName ) ); - pToolBox->SetQuickHelpText( nId, vcl::CommandInfoProvider::GetTooltipForCommand( rCommand, m_xFrame ) ); + 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 ) @@ -521,8 +522,11 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& m_bReadOnly = m_xStorable.is() && m_xStorable->isReadonly(); if ( bLastReadOnly != m_bReadOnly ) { + OUString sCommand = m_bReadOnly ? OUString( ".uno:SaveAs" ) : m_aCommandURL; + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sCommand, + vcl::CommandInfoProvider::GetModuleIdentifier(m_xFrame)); pToolBox->SetQuickHelpText( nId, - vcl::CommandInfoProvider::GetTooltipForCommand( m_bReadOnly ? OUString( ".uno:SaveAs" ) : m_aCommandURL, m_xFrame ) ); + vcl::CommandInfoProvider::GetTooltipForCommand(sCommand, aProperties, m_xFrame) ); pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( m_bReadOnly ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) ); pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( m_bReadOnly ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) ); updateImage(); diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index 89e237c32d56..79c64dd62bf2 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -446,7 +446,8 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc if (( nType == css::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { - OUString aString( vcl::CommandInfoProvider::GetLabelForCommand(aCommandURL, "")); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, ""); + OUString aString(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); StatusBarItemBits nItemBits( impl_convertItemStyleToItemBits( nStyle )); m_pStatusBar->InsertItem( nId, nWidth, nItemBits, nOffset ); diff --git a/framework/source/uielement/thesaurusmenucontroller.cxx b/framework/source/uielement/thesaurusmenucontroller.cxx index bfff4cb778a0..179a611b0b8c 100644 --- a/framework/source/uielement/thesaurusmenucontroller.cxx +++ b/framework/source/uielement/thesaurusmenucontroller.cxx @@ -103,7 +103,8 @@ void ThesaurusMenuController::fillPopupMenu() pVCLMenu->InsertSeparator(); OUString aThesaurusDialogCmd( ".uno:ThesaurusDialog" ); - pVCLMenu->InsertItem( nId, vcl::CommandInfoProvider::GetPopupLabelForCommand( aThesaurusDialogCmd, m_aModuleName ) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aThesaurusDialogCmd, m_aModuleName); + pVCLMenu->InsertItem( nId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties) ); pVCLMenu->SetItemCommand( nId, aThesaurusDialogCmd ); } } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 5fdb7b223bc4..89cbbb2e5d3f 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -683,7 +683,8 @@ void ToolBarManager::CreateControllers() OUString aCommandURL( m_pToolBar->GetItemCommand( nId ) ); // Command can be just an alias to another command. - OUString aRealCommandURL( vcl::CommandInfoProvider::GetRealCommandForCommand( aCommandURL, m_aModuleIdentifier ) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, m_aModuleIdentifier); + OUString aRealCommandURL( vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties) ); if ( !aRealCommandURL.isEmpty() ) aCommandURL = aRealCommandURL; @@ -1020,15 +1021,16 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if (( nType == css::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { - OUString aString(vcl::CommandInfoProvider::GetLabelForCommand(aCommandURL, m_aModuleIdentifier)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, m_aModuleIdentifier); + OUString aString(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( nStyle ); m_pToolBar->InsertItem( nId, aString, nItemBits ); m_pToolBar->SetItemCommand( nId, aCommandURL ); if ( !aTooltip.isEmpty() ) - m_pToolBar->SetQuickHelpText( nId, aTooltip ); + m_pToolBar->SetQuickHelpText(nId, aTooltip); else - m_pToolBar->SetQuickHelpText( nId, vcl::CommandInfoProvider::GetTooltipForCommand(aCommandURL, m_xFrame) ); + m_pToolBar->SetQuickHelpText(nId, vcl::CommandInfoProvider::GetTooltipForCommand(aCommandURL, aProperties, m_xFrame)); if ( !aLabel.isEmpty() ) { diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 91c81511766e..080d833f2134 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -150,7 +150,10 @@ void ToolbarsMenuController::addCommand( OUString aLabel; if ( rLabel.isEmpty() ) - aLabel = vcl::CommandInfoProvider::GetMenuLabelForCommand( rCommandURL, m_aModuleName ); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommandURL, m_aModuleName); + aLabel = vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties); + } else aLabel = rLabel; diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx index 8b5bac1a5c31..5327434cb168 100644 --- a/include/vcl/commandinfoprovider.hxx +++ b/include/vcl/commandinfoprovider.hxx @@ -24,6 +24,10 @@ namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } } +namespace com { namespace sun { namespace star { + namespace beans { struct PropertyValue; } +} } } + namespace vcl { namespace CommandInfoProvider { /** Return a label for the given command. @@ -32,23 +36,27 @@ namespace vcl { namespace CommandInfoProvider { @param rsModuleName The current application module. @return + The command properties. + */ + VCL_DLLPUBLIC css::uno::Sequence<css::beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName); + + /** Return a label for the given command. + @param rProperties + The properties from GetCommandProperties. + @return The command label. */ - VCL_DLLPUBLIC OUString GetLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName); + VCL_DLLPUBLIC OUString GetLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties); - VCL_DLLPUBLIC OUString GetMenuLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName); + VCL_DLLPUBLIC OUString GetMenuLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties); - VCL_DLLPUBLIC OUString GetPopupLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName); + VCL_DLLPUBLIC OUString GetPopupLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties); /** Return a tooltip for the given command. Falls back to label if command has no tooltip. @param rsCommandName The command name is expected to start with .uno: + @param rProperties + The properties from GetCommandProperties. @param rxFrame The frame is used to identify the module and document. @return @@ -57,14 +65,14 @@ namespace vcl { namespace CommandInfoProvider { */ VCL_DLLPUBLIC OUString GetTooltipForCommand ( const OUString& rsCommandName, + const css::uno::Sequence<css::beans::PropertyValue>& rProperties, const css::uno::Reference<css::frame::XFrame>& rxFrame); /** Returns the shortcut for a command in human-readable form */ VCL_DLLPUBLIC OUString GetCommandShortcut (const OUString& rCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame); - VCL_DLLPUBLIC OUString GetRealCommandForCommand( const OUString& rCommandName, - const OUString& rsModuleName ); + VCL_DLLPUBLIC OUString GetRealCommandForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties); VCL_DLLPUBLIC css::uno::Reference<css::graphic::XGraphic> GetXGraphicForCommand( const OUString& rsCommandName, diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index fc64f7439d78..f4c5804d4522 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -226,7 +226,10 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, vcl::W OUString sSlotTitle; if( bInsertPage ) - sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand( sSlotStr, rController.getModuleName() ); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, rController.getModuleName()); + sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); + } else sSlotTitle = SdResId( STR_RESET_LAYOUT ); appendEntry( 2, sSlotTitle, aSlotImage); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 89ee4c17138e..5f872e7b8a7b 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -963,7 +963,8 @@ vcl::Window* ViewShellBase::GetViewWindow() OUString ViewShellBase::RetrieveLabelFromCommand( const OUString& aCmdURL ) const { OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface())); - return vcl::CommandInfoProvider::GetLabelForCommand( aCmdURL, aModuleName ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCmdURL, aModuleName); + return vcl::CommandInfoProvider::GetLabelForCommand(aProperties); } int ViewShellBase::getPart() const diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index c4c1735f6418..6e8c4b20151b 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -594,7 +594,8 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* pWindow ) { OUString sModuleName = GetHelpModuleName_Impl(aCommandURL); - OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( aCommandURL, getCurrentModuleIdentifier_Impl() ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, getCurrentModuleIdentifier_Impl()); + OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); OUString sHelpText = SfxHelp_Impl::GetHelpText( sRealCommand.isEmpty() ? aCommandURL : sRealCommand, sModuleName ); OString aNewHelpId; @@ -635,7 +636,8 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p OUString SfxHelp::GetHelpText(const OUString& aCommandURL, const weld::Widget* pWidget) { OUString sModuleName = GetHelpModuleName_Impl(aCommandURL); - OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( aCommandURL, getCurrentModuleIdentifier_Impl() ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, getCurrentModuleIdentifier_Impl()); + OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); OUString sHelpText = SfxHelp_Impl::GetHelpText( sRealCommand.isEmpty() ? aCommandURL : sRealCommand, sModuleName ); OString aNewHelpId; @@ -1046,8 +1048,11 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const OUString aRealCommand; if ( nProtocol == INetProtocol::Uno ) + { // Command can be just an alias to another command. - aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( rURL, getCurrentModuleIdentifier_Impl() ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rURL, getCurrentModuleIdentifier_Impl()); + aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); + } // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( aRealCommand.isEmpty() ? rURL : aRealCommand, aHelpModuleName ); @@ -1221,8 +1226,11 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt OUString aRealCommand; if ( nProtocol == INetProtocol::Uno ) + { // Command can be just an alias to another command. - aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( rURL, getCurrentModuleIdentifier_Impl() ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rURL, getCurrentModuleIdentifier_Impl()); + aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); + } // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( aRealCommand.isEmpty() ? rURL : aRealCommand, aHelpModuleName ); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 2bda9d438466..55d8a0f7d515 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2434,17 +2434,20 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox, void ) ScopedVclPtrInstance<PopupMenu> pMenu; OUString sTextDoc("com.sun.star.text.TextDocument"); - OUString sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:StyleNewByExample", sTextDoc); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:StyleNewByExample", sTextDoc); + OUString sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); pMenu->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); - sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:StyleUpdateByExample", sTextDoc); + aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:StyleUpdateByExample", sTextDoc); + sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); pMenu->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); pMenu->InsertSeparator(); - sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:LoadStyles", sTextDoc); + aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:LoadStyles", sTextDoc); + sLabel = vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel ); pMenu->SetHelpId(SID_TEMPLATE_LOAD, ".uno:LoadStyles"); diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx index b023da87d184..643d364bb266 100644 --- a/sfx2/source/sidebar/ControllerFactory.cxx +++ b/sfx2/source/sidebar/ControllerFactory.cxx @@ -124,9 +124,10 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController( // Add tooltip. if (xController.is()) { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rsCommandName, + vcl::CommandInfoProvider::GetModuleIdentifier(rxFrame)); const OUString sTooltip (vcl::CommandInfoProvider::GetTooltipForCommand( - rsCommandName, - rxFrame)); + rsCommandName, aProperties, rxFrame)); if (pToolBox->GetQuickHelpText(nItemId).isEmpty()) pToolBox->SetQuickHelpText(nItemId, sTooltip); pToolBox->EnableItem(nItemId); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index a0598191f3f7..80cd8a122d07 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -720,9 +720,9 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); OUStringBuffer aBuffer( 60 ); - aBuffer.append( vcl::CommandInfoProvider::GetLabelForCommand( - ".uno:PrintDefault", - vcl::CommandInfoProvider::GetModuleIdentifier( xFrame ) ) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:PrintDefault", + vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); + aBuffer.append(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); aBuffer.append( " (" ); aBuffer.append( aPrinterName ); aBuffer.append(')'); diff --git a/svx/source/mnuctrls/smarttagmenu.cxx b/svx/source/mnuctrls/smarttagmenu.cxx index dd55876b85ed..92d205556c00 100644 --- a/svx/source/mnuctrls/smarttagmenu.cxx +++ b/svx/source/mnuctrls/smarttagmenu.cxx @@ -182,7 +182,8 @@ void SmartTagMenuController::FillMenu() { const OUString aCommand = ".uno:AutoCorrectDlg?OpenSmartTag:bool=true"; pVCLMenu->InsertSeparator(); - pVCLMenu->InsertItem( nMenuId, vcl::CommandInfoProvider::GetPopupLabelForCommand( aCommand, m_aModuleName ) ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, m_aModuleName); + pVCLMenu->InsertItem( nMenuId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties) ); pVCLMenu->SetItemCommand( nMenuId, aCommand ); } } diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx index 74079228f65e..09685b182251 100644 --- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx +++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx @@ -127,7 +127,9 @@ void DefaultShapesPanel::populateShapes() { sSlotStr = aSet.second[i]; aSlotImage = vcl::CommandInfoProvider::GetImageForCommand(sSlotStr, mxFrame); - sLabel = vcl::CommandInfoProvider::GetTooltipForCommand(sSlotStr, mxFrame); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, + vcl::CommandInfoProvider::GetModuleIdentifier(mxFrame)); + sLabel = vcl::CommandInfoProvider::GetTooltipForCommand(sSlotStr, aProperties, mxFrame); aSet.first->InsertItem(i, aSlotImage, sLabel); } } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 1b8d6fe09092..4e6e10e84138 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3454,7 +3454,8 @@ void SvxColorToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any> // Sidebar uses wide buttons for those. m_bSplitButton = typeid( *pToolBox ) != typeid( sfx2::sidebar::SidebarToolBox ); - OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand( getCommandURL(), getModuleName() ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(getCommandURL(), getModuleName()); + OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); m_xBtnUpdater.reset( new svx::ToolboxButtonColorUpdater( m_nSlotId, nId, pToolBox, !m_bSplitButton, aCommandLabel ) ); pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( m_bSplitButton ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) ); @@ -3517,7 +3518,8 @@ VclPtr<vcl::Window> SvxColorToolBoxControl::createPopupWindow( vcl::Window* pPar false, m_aColorSelectFunction); - OUString aWindowTitle = vcl::CommandInfoProvider::GetLabelForCommand( m_aCommandURL, m_sModuleName ); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(m_aCommandURL, m_sModuleName); + OUString aWindowTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); pColorWin->SetText( aWindowTitle ); pColorWin->StartSelection(); if ( m_bSplitButton ) diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 8cc000318df0..902974516fd9 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -292,17 +292,24 @@ SwSpellPopup::SwSpellPopup( uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(); OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); - OUString aIgnoreSelection( SwResId( STR_IGNORE_SELECTION ) ); - m_xPopupMenu->SetItemText(m_nSpellDialogId, - vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:SpellingAndGrammarDialog", aModuleName)); - m_xPopupMenu->SetItemText(m_nCorrectDialogId, - vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:AutoCorrectDlg", aModuleName)); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:SpellingAndGrammarDialog", aModuleName); + m_xPopupMenu->SetItemText(m_nSpellDialogId, + vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties)); + } + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:AutoCorrectDlg", aModuleName); + m_xPopupMenu->SetItemText(m_nCorrectDialogId, + vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties)); + } + if (comphelper::LibreOfficeKit::isActive()) { m_xPopupMenu->HideItem(m_nCorrectDialogId); m_xPopupMenu->HideItem(m_nAddId); } sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId); + OUString aIgnoreSelection( SwResId( STR_IGNORE_SELECTION ) ); m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos); m_xPopupMenu->SetHelpId(MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION); @@ -511,8 +518,9 @@ SwSpellPopup::SwSpellPopup( OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); OUString aIgnoreSelection( SwResId( STR_IGNORE_SELECTION ) ); + auto aCommandProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:SpellingAndGrammarDialog", aModuleName); m_xPopupMenu->SetItemText(m_nSpellDialogId, - vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:SpellingAndGrammarDialog", aModuleName)); + vcl::CommandInfoProvider::GetPopupLabelForCommand(aCommandProperties)); sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId); m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos); m_xPopupMenu->SetHelpId(MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION); diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 14874c78f544..be2997a8a5db 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -880,16 +880,25 @@ void SwFrameShell::GetState(SfxItemSet& rSet) { case SID_OBJECT_ALIGN_UP : case FN_FRAME_ALIGN_VERT_TOP: - sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(".uno:AlignTop", aModuleName); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:AlignTop", aModuleName); + sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); break; + } case SID_OBJECT_ALIGN_MIDDLE: case FN_FRAME_ALIGN_VERT_CENTER: - sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(".uno:AlignVerticalCenter", aModuleName); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:AlignVerticalCenter", aModuleName); + sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); break; + } case SID_OBJECT_ALIGN_DOWN: case FN_FRAME_ALIGN_VERT_BOTTOM: - sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(".uno:AlignBottom", aModuleName); + { + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:AlignBottom", aModuleName); + sNewLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); break; + } } } if ( !sNewLabel.isEmpty() ) diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx index 9e20d7f69a0d..8fc3a16459cf 100644 --- a/vcl/source/app/weldutils.cxx +++ b/vcl/source/app/weldutils.cxx @@ -117,9 +117,11 @@ ToolbarUnoDispatcher::ToolbarUnoDispatcher(Toolbar& rToolbar, { OUString sCommand = OUString::fromUtf8(rToolbar.get_item_ident(i)); - OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(sCommand, aModuleName)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sCommand, aModuleName); + OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); rToolbar.set_item_label(i, aLabel); - OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(sCommand, rFrame)); + OUString aTooltip( + vcl::CommandInfoProvider::GetTooltipForCommand(sCommand, aProperties, rFrame)); rToolbar.set_item_tooltip_text(i, aTooltip); auto xImage(vcl::CommandInfoProvider::GetXGraphicForCommand(sCommand, rFrame, eSize)); rToolbar.set_item_icon(i, xImage); diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index ad6f2457a394..234a73eb2949 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -181,7 +181,7 @@ static bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCom return false; } -static Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) +Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) { Sequence<beans::PropertyValue> aProperties; @@ -202,12 +202,11 @@ static Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCom return aProperties; } -static OUString GetCommandProperty(const OUString& rsProperty, const OUString& rsCommandName, const OUString& rsModuleName) +static OUString GetCommandProperty(const OUString& rsProperty, const Sequence<beans::PropertyValue> &rProperties) { - const Sequence<beans::PropertyValue> aProperties (GetCommandProperties(rsCommandName, rsModuleName)); - auto pProp = std::find_if(aProperties.begin(), aProperties.end(), + auto pProp = std::find_if(rProperties.begin(), rProperties.end(), [&rsProperty](const beans::PropertyValue& rProp) { return rProp.Name == rsProperty; }); - if (pProp != aProperties.end()) + if (pProp != rProperties.end()) { OUString sLabel; pProp->Value >>= sLabel; @@ -216,40 +215,34 @@ static OUString GetCommandProperty(const OUString& rsProperty, const OUString& r return OUString(); } -OUString GetLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName) +OUString GetLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties) { - return GetCommandProperty("Name", rsCommandName, rsModuleName); + return GetCommandProperty("Name", rProperties); } -OUString GetMenuLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName) +OUString GetMenuLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties) { // Here we want to use "Label", not "Name". "Name" is a stripped-down version of "Label" without accelerators // and ellipsis. In the menu, we want to have those accelerators and ellipsis. - return GetCommandProperty("Label", rsCommandName, rsModuleName); + return GetCommandProperty("Label", rProperties); } -OUString GetPopupLabelForCommand ( - const OUString& rsCommandName, - const OUString& rsModuleName) +OUString GetPopupLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties) { - OUString sPopupLabel(GetCommandProperty("PopupLabel", rsCommandName, rsModuleName)); + OUString sPopupLabel(GetCommandProperty("PopupLabel", rProperties)); if (!sPopupLabel.isEmpty()) return sPopupLabel; - return GetCommandProperty("Label", rsCommandName, rsModuleName); + return GetCommandProperty("Label", rProperties); } -OUString GetTooltipForCommand ( +OUString GetTooltipForCommand( const OUString& rsCommandName, + const css::uno::Sequence<css::beans::PropertyValue>& rProperties, const Reference<frame::XFrame>& rxFrame) { - OUString sModuleName(GetModuleIdentifier(rxFrame)); - OUString sLabel (GetCommandProperty("TooltipLabel", rsCommandName, sModuleName)); + OUString sLabel(GetCommandProperty("TooltipLabel", rProperties)); if (sLabel.isEmpty()) { - sLabel = GetPopupLabelForCommand(rsCommandName, sModuleName); + sLabel = GetPopupLabelForCommand(rProperties); // Remove '...' at the end and mnemonics (we don't want those in tooltips) sLabel = comphelper::string::stripEnd(sLabel, '.'); sLabel = MnemonicGenerator::EraseAllMnemonicChars(sLabel); @@ -257,7 +250,7 @@ OUString GetTooltipForCommand ( // Command can be just an alias to another command, // so need to get the shortcut of the "real" command. - const OUString sRealCommand(GetRealCommandForCommand(rsCommandName, sModuleName)); + const OUString sRealCommand(GetRealCommandForCommand(rProperties)); const OUString sShortCut(GetCommandShortcut(!sRealCommand.isEmpty() ? sRealCommand : rsCommandName, rxFrame)); if (!sShortCut.isEmpty()) return sLabel + " (" + sShortCut + ")"; @@ -285,10 +278,9 @@ OUString GetCommandShortcut (const OUString& rsCommandName, return OUString(); } -OUString GetRealCommandForCommand(const OUString& rCommandName, - const OUString& rsModuleName) +OUString GetRealCommandForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties) { - return GetCommandProperty("TargetURL", rCommandName, rsModuleName); + return GetCommandProperty("TargetURL", rProperties); } Reference<graphic::XGraphic> GetXGraphicForCommand(const OUString& rsCommandName, diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 5663a2e09989..91bf9857b102 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1213,11 +1213,12 @@ namespace return; OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(rFrame)); - OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(aCommand, aModuleName)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, aModuleName); + OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); if (!aLabel.isEmpty()) pButton->SetText(aLabel); - OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(aCommand, rFrame)); + OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(aCommand, aProperties, rFrame)); if (!aTooltip.isEmpty()) pButton->SetQuickHelpText(aTooltip); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 34ceee0069aa..1d25c089e976 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -464,8 +464,9 @@ void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::f if (rFrame.is()) { OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(rFrame)); - OUString aLabel(CommandInfoProvider::GetPopupLabelForCommand(rCommand, aModuleName)); - OUString aTooltip(CommandInfoProvider::GetTooltipForCommand(rCommand, rFrame)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommand, aModuleName); + OUString aLabel(CommandInfoProvider::GetPopupLabelForCommand(aProperties)); + OUString aTooltip(CommandInfoProvider::GetTooltipForCommand(rCommand, aProperties, rFrame)); Image aImage(CommandInfoProvider::GetImageForCommand(rCommand, rFrame)); InsertItem(nItemId, aLabel, aImage); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 3cd3ed85a5ed..2e24c83e7be9 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -422,8 +422,9 @@ void ToolBox::InsertItem(const OUString& rCommand, const css::uno::Reference<css const Size& rRequestedSize, ImplToolItems::size_type nPos) { OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(rFrame)); - OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(rCommand, aModuleName)); - OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(rCommand, rFrame)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(rCommand, aModuleName); + OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); + OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(rCommand, aProperties, rFrame)); Image aImage(CommandInfoProvider::GetImageForCommand(rCommand, rFrame, GetImageSize())); sal_uInt16 nItemId = GetItemCount() + 1; |