summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx26
1 files changed, 26 insertions, 0 deletions
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();