diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-07-27 19:47:01 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-30 10:02:56 +0000 |
commit | d5266a9e3f367752e2b2099e542518078271edcc (patch) | |
tree | e21d4ef4dfde97bf0e15c52b96d1c10ae0339634 /include | |
parent | 0c1d2fcdcfbfe83317e8660dd6165f3b438e80ad (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.
(cherry picked from commit 787940e0ac285aa1101ca8964d252faaab3ea8c1, plus
04f4d4bfb708ef477618fa47d5f17779f4e4cf3c "Add TODO comment expressing doubts
about existing code")
Conflicts:
sfx2/source/appl/appdde.cxx
Change-Id: I527d620c60a87f3a01d970927c521163fb6df192
Reviewed-on: https://gerrit.libreoffice.org/5192
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/app.hxx | 1 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 40 |
2 files changed, 32 insertions, 9 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 858140d2b8be..9ab77df8fd98 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 101de7a07a4c..ff5f79e132e5 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; }; |