summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-12-12 01:38:02 -0500
committerMichael Meeks <michael.meeks@collabora.com>2020-05-27 21:59:07 +0100
commit3f34eb6d9c78538066ef3b25154bcb41e07b751f (patch)
tree100baf17ba1c0bdd5b0aafe41102332ee14775b9 /sfx2/source/sidebar
parent846dc98f51ed21ad1db97dce285a6b789839f287 (diff)
sfx2: sidebar: publish created notification on Mobile too
Reviewed-on: https://gerrit.libreoffice.org/85011 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 50af967b731495be6645f065fd11b9ad832a654a) Change-Id: I59e5db039a6c1f29cb13e7c77a782659dbfb6894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85786 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sfx2/source/sidebar')
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx37
1 files changed, 18 insertions, 19 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index e6dbcaf0b76e..7362b2772642 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -77,28 +77,27 @@ public:
pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str());
}
}
- else
- {
- // On desktop use the classic notifications.
- const Point pos(m_rSidebarDockingWin.GetOutOffXPixel(),
- m_rSidebarDockingWin.GetOutOffYPixel());
- const OString posMessage = pos.toString();
- const OString sizeMessage = m_rSidebarDockingWin.GetSizePixel().toString();
- const std::string message = OString(posMessage + sizeMessage).getStr();
- const vcl::LOKWindowId lokWindowId = m_rSidebarDockingWin.GetLOKWindowId();
+ // Notify the sidebar is created, and its LOKWindowId, which
+ // is needed on both Mobile and Desktop.
+ const Point pos(m_rSidebarDockingWin.GetOutOffXPixel(),
+ m_rSidebarDockingWin.GetOutOffYPixel());
+ const OString posMessage = pos.toString();
+ const OString sizeMessage = m_rSidebarDockingWin.GetSizePixel().toString();
- if (lokWindowId != m_LastLOKWindowId || message != m_LastNotificationMessage)
- {
- m_LastLOKWindowId = lokWindowId;
- m_LastNotificationMessage = message;
+ const std::string message = OString(posMessage + sizeMessage).getStr();
+ const vcl::LOKWindowId lokWindowId = m_rSidebarDockingWin.GetLOKWindowId();
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back("type", "deck");
- aItems.emplace_back("position", posMessage);
- aItems.emplace_back("size", sizeMessage);
- pNotifier->notifyWindow(lokWindowId, "created", aItems);
- }
+ if (lokWindowId != m_LastLOKWindowId || message != m_LastNotificationMessage)
+ {
+ m_LastLOKWindowId = lokWindowId;
+ m_LastNotificationMessage = message;
+
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("type", "deck");
+ aItems.emplace_back("position", posMessage);
+ aItems.emplace_back("size", sizeMessage);
+ pNotifier->notifyWindow(lokWindowId, "created", aItems);
}
}
catch (boost::property_tree::json_parser::json_parser_error& rError)