[Libreoffice-commits] core.git: comphelper/source desktop/source include/comphelper vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Apr 22 05:16:12 PDT 2015
comphelper/source/misc/dispatchcommand.cxx | 4 ++--
desktop/source/lib/init.cxx | 2 +-
include/comphelper/dispatchcommand.hxx | 4 +++-
vcl/source/control/button.cxx | 2 +-
4 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit eaf41045822732653a0af91ac0faa28fca7f0894
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Apr 22 12:22:06 2015 +0200
comphelper::dispatchCommand: allow passing command arguments
Change-Id: I6464c5d1a46fadac2510700101f3c8cc29dd7995
diff --git a/comphelper/source/misc/dispatchcommand.cxx b/comphelper/source/misc/dispatchcommand.cxx
index dd43523..5de0554 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 a1162df..c1237ac 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 7289dd7..58aa0b9 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 1e6c2e5..30e111a 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;
More information about the Libreoffice-commits
mailing list