diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-22 12:22:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-22 14:11:47 +0200 |
commit | eaf41045822732653a0af91ac0faa28fca7f0894 (patch) | |
tree | e28628a836b7f2bf55f3ab69032cbdf5ae67f293 | |
parent | 017f250764ec7b4ecb82ac19f5b3f68cadf1bf56 (diff) |
comphelper::dispatchCommand: allow passing command arguments
Change-Id: I6464c5d1a46fadac2510700101f3c8cc29dd7995
-rw-r--r-- | comphelper/source/misc/dispatchcommand.cxx | 4 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 2 | ||||
-rw-r--r-- | include/comphelper/dispatchcommand.hxx | 4 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/comphelper/source/misc/dispatchcommand.cxx b/comphelper/source/misc/dispatchcommand.cxx index dd43523fcc2f..5de05542dbb4 100644 --- a/comphelper/source/misc/dispatchcommand.cxx +++ b/comphelper/source/misc/dispatchcommand.cxx @@ -30,7 +30,7 @@ using namespace css; namespace comphelper { -bool dispatchCommand(const OUString& rCommand) +bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::beans::PropertyValue>& rArguments) { // Target where we will execute the .uno: command uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); @@ -54,7 +54,7 @@ bool dispatchCommand(const OUString& rCommand) return false; // And do the work... - xDisp->dispatch(aCommandURL, uno::Sequence<beans::PropertyValue>()); + xDisp->dispatch(aCommandURL, rArguments); return true; } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a1162dfe21bc..c1237ac1eca3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -705,7 +705,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* /*pThis*/, const char* pC { OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8); - if (!comphelper::dispatchCommand(aCommand)) + if (!comphelper::dispatchCommand(aCommand, uno::Sequence<beans::PropertyValue>())) { gImpl->maLastExceptionMsg = "Failed to dispatch the .uno: command"; } diff --git a/include/comphelper/dispatchcommand.hxx b/include/comphelper/dispatchcommand.hxx index 7289dd7e7c58..58aa0b940f4e 100644 --- a/include/comphelper/dispatchcommand.hxx +++ b/include/comphelper/dispatchcommand.hxx @@ -12,6 +12,8 @@ #include <comphelper/comphelperdllapi.h> #include <rtl/ustring.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> namespace comphelper { @@ -22,7 +24,7 @@ namespace comphelper @return true on success. */ -COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand); +COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::beans::PropertyValue>& rArguments); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 1e6c2e5fcd22..30e111a674d1 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -599,7 +599,7 @@ sal_IntPtr Button::dispatchCommandHandler(void *, void *pCaller) if (pButton == NULL) return 0; - if (!comphelper::dispatchCommand(pButton->maCommand)) + if (!comphelper::dispatchCommand(pButton->maCommand, uno::Sequence<beans::PropertyValue>())) return 0; return 1; |