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

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 11 21:07:35 UTC 2019


 sfx2/source/sidebar/SidebarController.cxx |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 52bfa7294ce18456c6285ed4897e0ed318dbb98e
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Dec 11 12:23:08 2019 -0500
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Wed Dec 11 22:06:46 2019 +0100

    sfx2: sidebar: notify mobile when the sidebar closes
    
    Change-Id: Idb05346a9ccc8690cad566b74ec86d5fdd3bfb35
    Reviewed-on: https://gerrit.libreoffice.org/84973
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 4a7942b16453..561bc1e18ce5 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1211,7 +1211,21 @@ void SidebarController::RequestCloseDeck()
     if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck.get())
     {
         const vcl::ILibreOfficeKitNotifier* pNotifier = mpCurrentDeck->GetLOKNotifier();
-        if (pNotifier)
+        auto pMobileNotifier = SfxViewShell::Current();
+        if (pMobileNotifier && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+        {
+            // Mobile.
+            std::stringstream aStream;
+            boost::property_tree::ptree aTree;
+            aTree.put("id", mpParentWindow->get_id()); // TODO could be missing - sort out
+            aTree.put("type", "dockingwindow");
+            aTree.put("text", mpParentWindow->GetText());
+            aTree.put("enabled", false);
+            boost::property_tree::write_json(aStream, aTree);
+            const std::string message = aStream.str();
+            pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str());
+        }
+        else if (pNotifier)
             pNotifier->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close");
     }
 


More information about the Libreoffice-commits mailing list