diff options
Diffstat (limited to 'kit')
-rw-r--r-- | kit/ChildSession.cpp | 22 | ||||
-rw-r--r-- | kit/ChildSession.hpp | 5 |
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(); |