summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-07-27 19:47:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-07-27 19:47:01 +0200
commit787940e0ac285aa1101ca8964d252faaab3ea8c1 (patch)
tree1f9dc8a0ae0693e31aa79d4e2d47586b5e603fde /include
parenta1c081a7c213a56321b0b60651a1dbd63bcaec80 (diff)
fdo#54264: Fix multi-argument ApplicationEvent::TYPE_OPEN/PRINT
...that had been broken when 5c22a03320f20ae9ac2c3c16025e7c5e3a7915d5> "Cleaned up CommandLineArgs" changed the representation of those multi-arguments from a single string with \n delimiters to vector<string> in desktop/soruce/app/cmdlineargs.hxx, but missed updating other producers of such ApplicationEvents. Change-Id: I527d620c60a87f3a01d970927c521163fb6df192
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/app.hxx1
-rw-r--r--include/vcl/svapp.hxx40
2 files changed, 32 insertions, 9 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index d202219d917b..e2b90959af88 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -40,7 +40,6 @@
#include <vector>
class Timer;
-class ApplicationEvent;
class WorkWindow;
class ISfxTemplateCommon;
class BasicManager;
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 886a41401be7..2ceb713367f4 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -24,7 +24,9 @@
#include <sal/config.h>
+#include <cassert>
#include <stdexcept>
+#include <vector>
#include <comphelper/solarmutex.hxx>
#include <osl/thread.hxx>
@@ -100,20 +102,42 @@ public:
TYPE_SHOWDIALOG, TYPE_UNACCEPT
};
- ApplicationEvent() {}
+ explicit ApplicationEvent(Type type): aEvent(type) {
+ assert(
+ type == TYPE_APPEAR || type == TYPE_VERSION
+ || type == TYPE_PRIVATE_DOSHUTDOWN || type == TYPE_QUICKSTART);
+ }
+
+ ApplicationEvent(Type type, OUString const & data): aEvent(type) {
+ assert(
+ type == TYPE_ACCEPT || type == TYPE_HELP || type == TYPE_OPENHELPURL
+ || type == TYPE_SHOWDIALOG || type == TYPE_UNACCEPT);
+ aData.push_back(data);
+ }
- explicit ApplicationEvent(
- Type rEvent, const OUString& rData = OUString()):
- aEvent(rEvent),
- aData(rData)
- {}
+ ApplicationEvent(Type type, std::vector<OUString> const & data):
+ aEvent(type), aData(data)
+ { assert(type == TYPE_OPEN || type == TYPE_PRINT); }
Type GetEvent() const { return aEvent; }
- const OUString& GetData() const { return aData; }
+
+ OUString GetStringData() const {
+ assert(
+ aEvent == TYPE_ACCEPT || aEvent == TYPE_HELP
+ || aEvent == TYPE_OPENHELPURL || aEvent == TYPE_SHOWDIALOG
+ || aEvent == TYPE_UNACCEPT);
+ assert(aData.size() == 1);
+ return aData[0];
+ }
+
+ std::vector<OUString> const & GetStringsData() const {
+ assert(aEvent == TYPE_OPEN || aEvent == TYPE_PRINT);
+ return aData;
+ }
private:
Type aEvent;
- OUString aData;
+ std::vector<OUString> aData;
};