summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-11-10 11:33:03 +0100
committerAndras Timar <andras.timar@collabora.com>2021-11-11 16:00:35 +0100
commit4fc8c453da759b34e7460da6338a5c2d80e3d3c4 (patch)
tree672c59d9b4f26d2a331a47c8ea2e5cfb6636bb97 /framework
parent8b98f44b9643bdd873919185a617f530c04203e1 (diff)
Handle UNO command aliases in ToolBoxes
This allows to use ".uno:InsertSlide" which is an alias for ".uno:InsertPage" in the notebookbar. Change-Id: Ia52488b65e308a62b686e77b38cba3675deece73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124952 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125046 Tested-by: Jenkins
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/generictoolbarcontroller.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index aa2f7b0b9eb2..ad5de098cc71 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/frame/ControlCommand.hpp>
#include <comphelper/propertyvalue.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/weld.hxx>
@@ -155,7 +156,12 @@ void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
// Add key modifier to argument list
Sequence<PropertyValue> aArgs{ comphelper::makePropertyValue("KeyModifier", KeyModifier) };
- aTargetURL.Complete = aCommandURL;
+ // handle also command aliases
+ auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(m_aCommandURL,
+ vcl::CommandInfoProvider::GetModuleIdentifier(m_xFrame));
+ OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties);
+
+ aTargetURL.Complete = sRealCommand.isEmpty() ? aCommandURL : sRealCommand;
if ( m_xUrlTransformer.is() )
m_xUrlTransformer->parseStrict( aTargetURL );