diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-12-11 12:23:08 -0500 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-12-11 22:06:46 +0100 |
commit | 52bfa7294ce18456c6285ed4897e0ed318dbb98e (patch) | |
tree | 64b0eeca3bb2964ae8793b4f175872a7e8b970b8 /sfx2 | |
parent | cde58f1726f8da36968eb8faba76aee83a9d3448 (diff) |
sfx2: sidebar: notify mobile when the sidebar closes
Change-Id: Idb05346a9ccc8690cad566b74ec86d5fdd3bfb35
Reviewed-on: https://gerrit.libreoffice.org/84973
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
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"); } |