diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-07-06 14:15:17 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-08-17 17:13:44 +0200 |
commit | 2ca212f93cb4ae1da84fa71bf70dde24784e8df7 (patch) | |
tree | da0c09ec7e50256fd1d376ca1e62ea98b073fd3c /sfx2/source/sidebar | |
parent | 1692ee279c7d0a6aa8210c923a6923c6919f46d3 (diff) |
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@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120565
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2/source/sidebar')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index fff93887c3a7..803d1c10a739 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -40,6 +40,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> @@ -1229,6 +1230,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(); |