diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-06-10 10:43:05 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-06-10 11:29:53 +0200 |
commit | 64bd4dd2f80b247cb5df3f3e6c54bf2d47bc41a7 (patch) | |
tree | ed2d8bbaec310a10476ae05997e900ebd6658c6c /sfx2 | |
parent | 2fe8db830056a7cddf58f487a8b4aed4c718e589 (diff) |
jsdialog: sidebar: remove code for tunneled one
Change-Id: Idb60fdfc03729dd3755d5ef1ba61b2f9376e9556
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116965
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 77 |
2 files changed, 0 insertions, 99 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 51304f07bc9d..c120a9cc301c 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -1210,28 +1210,6 @@ IMPL_LINK(SidebarController, OnSubMenuItemSelected, const OString&, rCurItemId, void SidebarController::RequestCloseDeck() { - if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck) - { - const vcl::ILibreOfficeKitNotifier* pNotifier = mpCurrentDeck->GetLOKNotifier(); - auto pMobileNotifier = SfxViewShell::Current(); - const SfxViewShell* pViewShell = SfxViewShell::Current(); - if (pMobileNotifier && pViewShell && pViewShell->isLOKMobilePhone()) - { - // Mobile phone. - 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"); - } - mbIsDeckRequestedOpen = false; UpdateDeckOpenState(); diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index a7b752af67eb..c40cc06a952b 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -41,81 +41,11 @@ using namespace css::uno; namespace sfx2::sidebar { -class SidebarNotifyIdle : public Idle -{ - SidebarDockingWindow& m_rSidebarDockingWin; - std::string m_LastNotificationMessage; - vcl::LOKWindowId m_LastLOKWindowId; - -public: - SidebarNotifyIdle(SidebarDockingWindow &rSidebarDockingWin) : - Idle("Sidebar notify"), - m_rSidebarDockingWin(rSidebarDockingWin), - m_LastNotificationMessage(), - m_LastLOKWindowId(0) - { - SetPriority(TaskPriority::POST_PAINT); - } - - void Invoke() override - { - auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); - if (!pNotifier || !comphelper::LibreOfficeKit::isActive()) - return; - - try - { - const SfxViewShell* pOwnerView = dynamic_cast<const SfxViewShell*>(pNotifier); - if (pOwnerView && pOwnerView->isLOKMobilePhone()) - { - // Mobile phone. - tools::JsonWriter aJsonWriter; - m_rSidebarDockingWin.DumpAsPropertyTree(aJsonWriter); - aJsonWriter.put("id", m_rSidebarDockingWin.GetLOKWindowId()); - std::unique_ptr<char[]> data( aJsonWriter.extractData()); - std::string_view message(data.get()); - if (message != m_LastNotificationMessage) - { - m_LastNotificationMessage = message; - pOwnerView->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, m_LastNotificationMessage.c_str()); - } - } - - // Notify the sidebar is created, and its LOKWindowId, which - // is needed on mobile phones, tablets, and desktop. - 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(); - - 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) - { - SAL_WARN("sfx.sidebar", rError.message()); - } - } -}; - SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChildWindow& rChildWindow, vcl::Window* pParentWindow, WinBits nBits) : SfxDockingWindow(pSfxBindings, &rChildWindow, pParentWindow, nBits) , mpSidebarController() , mbIsReadyToDrag(false) - , mpIdleNotify(new SidebarNotifyIdle(*this)) { // Get the XFrame from the bindings. if (pSfxBindings==nullptr || pSfxBindings->GetDispatcher()==nullptr) @@ -152,12 +82,7 @@ void SidebarDockingWindow::LOKClose() { assert(comphelper::LibreOfficeKit::isActive()); if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - mpIdleNotify->Stop(); - - pNotifier->notifyWindow(GetLOKWindowId(), "close"); ReleaseLOKNotifier(); - } } void SidebarDockingWindow::GetFocus() @@ -206,8 +131,6 @@ void SidebarDockingWindow::NotifyResize() SetLOKNotifier(pCurrentView); } - - mpIdleNotify->Start(); } SfxChildAlignment SidebarDockingWindow::CheckAlignment ( |