diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-10-31 07:26:34 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-11-10 23:39:01 +0100 |
commit | 51d3360438c02f16cc7b29990244d4a72959fd2c (patch) | |
tree | fab8656eba882ee8a382c5462fddc4a860f42ce9 /sfx2 | |
parent | fb6da5e371a0cd7a6c12bc94ef051fced795a06c (diff) |
sidebar: check for valid current deck before closing
Also, cleanup unused/unnecessary LOKNotifier logic
from Deck.cxx and use emplace_back where possible.
Change-Id: I300c5158b12593e8130f5b6273c1ea3bcbefea7f
Reviewed-on: https://gerrit.libreoffice.org/82402
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 6 |
2 files changed, 4 insertions, 14 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index cca6df0f7286..66de858cc35c 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -81,9 +81,6 @@ Deck::~Deck() void Deck::dispose() { - if (comphelper::LibreOfficeKit::isActive()) - ReleaseLOKNotifier(); - SharedPanelContainer aPanels; aPanels.swap(maPanels); @@ -309,15 +306,6 @@ void Deck::ShowPanel(const Panel& rPanel) Point( mpScrollContainer->GetPosPixel().X(), -nNewThumbPos)); - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); - aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); - pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); - } } static const OUString GetWindowClassification(const vcl::Window* pWindow) diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 6096d9730358..7bf958ec6275 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -1208,9 +1208,11 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu, bool) void SidebarController::RequestCloseDeck() { - if (comphelper::LibreOfficeKit::isActive()) + if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck.get()) { - mpCurrentDeck->GetLOKNotifier()->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close"); + const vcl::ILibreOfficeKitNotifier* pNotifier = mpCurrentDeck->GetLOKNotifier(); + if (pNotifier) + pNotifier->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close"); } mbIsDeckRequestedOpen = false; |