[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - bundled/include kit/ChildSession.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon May 6 08:13:35 UTC 2019


 bundled/include/LibreOfficeKit/LibreOfficeKit.h      |    2 +-
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx    |    4 ++--
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |    3 ++-
 kit/ChildSession.cpp                                 |   17 ++++++++++++++++-
 4 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit 41163339ba7239c603d2145ea62262258e7a9e42
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Apr 18 18:22:18 2019 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon May 6 10:13:18 2019 +0200

    wsd: allow paste content to tunneled dialog
    
    Change-Id: I32fabaa533a0e9d853226b329d2d8b1c489dd776
    Reviewed-on: https://gerrit.libreoffice.org/70960
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/71370
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 1277d19b8..4b3800357 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -288,7 +288,7 @@ struct _LibreOfficeKitDocumentClass
                          const int width, const int height);
 
     /// @see lok::Document::postWindow().
-    void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction);
+    void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction, const char* pData);
 
     /// @see lok::Document::postWindowKeyEvent().
     void (*postWindowKeyEvent) (LibreOfficeKitDocument* pThis,
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 32fd0ff04..895ca5bf5 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -188,9 +188,9 @@ public:
      *
      * @param nWindowid
      */
-    void postWindow(unsigned nWindowId, int nAction)
+    void postWindow(unsigned nWindowId, int nAction, const char* pData)
     {
-        return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction);
+        return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction, pData);
     }
 
     /**
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index b7e3c199a..c8168f9b7 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -42,7 +42,8 @@ LibreOfficeKitTileMode;
 
 typedef enum
 {
-    LOK_WINDOW_CLOSE
+    LOK_WINDOW_CLOSE,
+    LOK_WINDOW_PASTE
 }
 LibreOfficeKitWindowAction;
 
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 07fd7c0c9..11b552e62 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1388,7 +1388,22 @@ bool ChildSession::sendWindowCommand(const char* /*buffer*/, int /*length*/, con
     getLOKitDocument()->setView(_viewId);
 
     if (tokens.size() > 2 && tokens[2] == "close")
-        getLOKitDocument()->postWindow(winId, LOK_WINDOW_CLOSE);
+        getLOKitDocument()->postWindow(winId, LOK_WINDOW_CLOSE, nullptr);
+    else if (tokens.size() > 3 && tokens[2] == "paste")
+    {
+        std::string data;
+        try
+        {
+            URI::decode(tokens[3], data);
+        }
+        catch (Poco::SyntaxException& exc)
+        {
+            sendTextFrame("error: cmd=windowcommand kind=syntax");
+            return false;
+        }
+
+        getLOKitDocument()->postWindow(winId, LOK_WINDOW_PASTE, data.c_str());
+    }
 
     return true;
 }


More information about the Libreoffice-commits mailing list