[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 6 12:51:34 UTC 2021


 sfx2/source/sidebar/SidebarController.cxx |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

New commits:
commit 74e69e555cc2b93df6b2be166aa1c70a99afa177
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jul 6 14:15:17 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Jul 6 14:50:59 2021 +0200

    jsdialog: sidebar: send message on sidebar close
    
    Revert needed code removed in 64bd4dd
    
    Change-Id: If45facbd68ea8f3af433b78e127fbb0745e62c25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118483
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 0f46d910d2cc..64dbe4343b14 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -44,6 +44,7 @@
 #include <vcl/svapp.hxx>
 #include <splitwin.hxx>
 #include <tools/diagnose_ex.h>
+#include <tools/json_writer.hxx>
 #include <tools/link.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <comphelper/processfactory.hxx>
@@ -1209,6 +1210,31 @@ IMPL_LINK(SidebarController, OnSubMenuItemSelected, const OString&, rCurItemId,
 
 void SidebarController::RequestCloseDeck()
 {
+    if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck)
+    {
+        const SfxViewShell* pViewShell = SfxViewShell::Current();
+        if (pViewShell && pViewShell->isLOKMobilePhone())
+        {
+            // Mobile phone - TODO: unify with desktop
+            tools::JsonWriter aJsonWriter;
+            aJsonWriter.put("id", mpParentWindow->get_id());
+            aJsonWriter.put("type", "dockingwindow");
+            aJsonWriter.put("text", mpParentWindow->GetText());
+            aJsonWriter.put("enabled", false);
+            const std::string message = aJsonWriter.extractAsStdString();
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str());
+        }
+        else if (pViewShell)
+        {
+            tools::JsonWriter aJsonWriter;
+            aJsonWriter.put("id", mpParentWindow->get_id());
+            aJsonWriter.put("action", "close");
+            aJsonWriter.put("jsontype", "sidebar");
+            const std::string message = aJsonWriter.extractAsStdString();
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str());
+        }
+    }
+
     mbIsDeckRequestedOpen = false;
     UpdateDeckOpenState();
 


More information about the Libreoffice-commits mailing list