summaryrefslogtreecommitdiffstats
path: root/kit
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-12-28 11:30:38 -0400
committerHenry Castro <hcastro@collabora.com>2021-01-05 11:10:22 -0400
commit9f43878891bcee48af710afccadf5643c6c1e53e (patch)
tree48833b5a6f719cb4a573be8a18d1baf09470c516 /kit
parentcypress: disable unstable multi-user test. (diff)
downloadonline-9f43878891bcee48af710afccadf5643c6c1e53e.tar.gz
online-9f43878891bcee48af710afccadf5643c6c1e53e.zip
kit: send early dialog event to server
When the "Macro Security Warning" send clicks events, the is no instance of Model/View/Controller yet. So adjust to send to global events. Change-Id: Idc395cfb86548481bbadc22874293d7d6238db89 Signed-off-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'kit')
-rw-r--r--kit/ChildSession.cpp22
-rw-r--r--kit/ChildSession.hpp5
2 files changed, 19 insertions, 8 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 40e7bb5849..832ca1b1dc 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -201,6 +201,10 @@ bool ChildSession::_handleInput(const char *buffer, int length)
{
return getCommandValues(buffer, length, tokens);
}
+ else if (tokens.equals(0, "dialogevent"))
+ {
+ return dialogEvent(buffer, length, tokens);
+ }
else if (tokens.equals(0, "load"))
{
if (_isDocLoaded)
@@ -445,10 +449,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
{
return removeTextContext(buffer, length, tokens);
}
- else if (tokens.equals(0, "dialogevent"))
- {
- return dialogEvent(buffer, length, tokens);
- }
else if (tokens.equals(0, "completefunction"))
{
return completeFunction(buffer, length, tokens);
@@ -1474,11 +1474,17 @@ bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const Str
return false;
}
- getLOKitDocument()->setView(_viewId);
-
unsigned long long int nLOKWindowId = std::stoull(tokens[1].c_str());
- getLOKitDocument()->sendDialogEvent(nLOKWindowId,
- tokens.cat(' ', 2).c_str());
+ if (_isDocLoaded)
+ {
+ getLOKitDocument()->setView(_viewId);
+ getLOKitDocument()->sendDialogEvent(nLOKWindowId,
+ tokens.cat(' ', 2).c_str());
+ }
+ else
+ {
+ getLOKit()->sendDialogEvent(nLOKWindowId, tokens.cat(' ', 2).c_str());
+ }
return true;
}
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index beb81e8cfc..138c7215a6 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -315,6 +315,11 @@ private:
return _docManager->getLOKitDocument();
}
+ std::shared_ptr<lok::Office> getLOKit() const
+ {
+ return _docManager->getLOKit();
+ }
+
std::string getLOKitLastError() const
{
char *lastErr = _docManager->getLOKit()->getError();