[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source vcl/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 10 22:39:41 UTC 2019


 sfx2/source/sidebar/Deck.cxx              |   12 ------------
 sfx2/source/sidebar/SidebarController.cxx |    6 ++++--
 vcl/source/window/paint.cxx               |    4 ++--
 3 files changed, 6 insertions(+), 16 deletions(-)

New commits:
commit 51d3360438c02f16cc7b29990244d4a72959fd2c
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Thu Oct 31 07:26:34 2019 -0400
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sun Nov 10 23:39:01 2019 +0100

    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 at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

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;
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index b7b8893be618..88712e3c72fa 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1220,11 +1220,11 @@ void Window::PixelInvalidate(const tools::Rectangle* pRectangle)
         // In case we are routing the window, notify the client
         std::vector<vcl::LOKPayloadItem> aPayload;
         if (pRectangle)
-            aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString()));
+            aPayload.emplace_back("rectangle", pRectangle->toString());
         else
         {
             const tools::Rectangle aRect(Point(0, 0), GetSizePixel());
-            aPayload.push_back(std::make_pair(OString("rectangle"), aRect.toString()));
+            aPayload.emplace_back("rectangle", aRect.toString());
         }
 
         pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload);


More information about the Libreoffice-commits mailing list