summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-10-31 07:26:34 -0400
committerMichael Meeks <michael.meeks@collabora.com>2019-12-16 17:29:59 +0000
commit98e569f29154c5f295516090186db5836e749a0d (patch)
tree4d7b1dad94a805426fb2c1d998be86dbe576acd3 /sfx2
parentfb9becb113d718cb4f1313d0ef2ca6bd0560fab9 (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.cxx12
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx7
2 files changed, 7 insertions, 12 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index e942cab3887b..d6c485b1f3c8 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);
@@ -318,15 +315,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 OUString GetWindowClassification(const vcl::Window* pWindow)
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 9214c651f3a6..14c78d918494 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1212,6 +1212,13 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu, bool)
void SidebarController::RequestCloseDeck()
{
+ if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck.get())
+ {
+ const vcl::ILibreOfficeKitNotifier* pNotifier = mpCurrentDeck->GetLOKNotifier();
+ if (pNotifier)
+ pNotifier->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close");
+ }
+
mbIsDeckRequestedOpen = false;
UpdateDeckOpenState();