[Libreoffice-commits] core.git: 2 commits - include/LibreOfficeKit include/sfx2 sd/source sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 25 07:30:18 UTC 2019


 include/LibreOfficeKit/LibreOfficeKitEnums.h |    1 
 include/sfx2/sidebar/Deck.hxx                |    1 
 sd/source/ui/view/drviews1.cxx               |    3 +
 sd/source/ui/view/drviewse.cxx               |    6 +++
 sfx2/source/sidebar/Deck.cxx                 |   53 +++++++++++++++++++++++++++
 5 files changed, 64 insertions(+)

New commits:
commit 6cb3b009fc4e73cc0ea07d166c274f05306b0e75
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Fri Sep 14 08:43:22 2018 -0400
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 25 09:29:47 2019 +0200

    sd: sidebars are now visible in LOOL
    
    Change-Id: I7ceae056e3d6ce1c991fe1194faa8bebfd6aae1e
    Reviewed-on: https://gerrit.libreoffice.org/73500
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 5b3dda95d7a3..a256a9629ac8 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -593,6 +593,7 @@ typedef enum
      * "type" tells the type of the window the action is associated with
      *  - "dialog" - window is a dialog
      *  - "child" - window is a floating window (combo boxes, etc.)
+     *  - "deck" - window is a docked/floating deck (i.e. the sidebar)
      *
      * "action" can take following values:
      * - "created" - window is created in the backend, client can render it now
diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index e3a3570f199a..22ecb71536d0 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -64,6 +64,7 @@ public:
     virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rUpdateArea) override;
     virtual void DataChanged (const DataChangedEvent& rEvent) override;
     virtual bool EventNotify(NotifyEvent& rEvent) override;
+    virtual void Resize() override;
 
     static void PrintWindowSubTree (vcl::Window* pRoot, int nIndentation);
 
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index e0405c9c279c..f26a643a083a 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -27,11 +27,15 @@
 #include <sfx2/sidebar/Panel.hxx>
 #include <sfx2/sidebar/Tools.hxx>
 #include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/lokhelper.hxx>
 
 #include <vcl/event.hxx>
+#include <comphelper/lok.hxx>
 #include <vcl/dockwin.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/commandevent.hxx>
+#include <vcl/IDialogRenderable.hxx>
 #include <tools/svborder.hxx>
 #include <sal/log.hxx>
 
@@ -61,6 +65,20 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
 
     mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange));
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        SetLOKNotifier(SfxViewShell::Current());
+
+        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);
+        }
+    }
+
 #ifdef DEBUG
     SetText(OUString("Deck"));
     mpScrollClipWindow->SetText(OUString("ScrollClipWindow"));
@@ -76,6 +94,9 @@ Deck::~Deck()
 
 void Deck::dispose()
 {
+    if (comphelper::LibreOfficeKit::isActive())
+        ReleaseLOKNotifier();
+
     SharedPanelContainer aPanels;
     aPanels.swap(maPanels);
 
@@ -168,6 +189,20 @@ bool Deck::EventNotify(NotifyEvent& rEvent)
     return Window::EventNotify(rEvent);
 }
 
+void Deck::Resize()
+{
+    Window::Resize();
+
+    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(), "size_changed", aItems);
+    }
+}
+
 bool Deck::ProcessWheelEvent(CommandEvent const * pCommandEvent)
 {
     if ( ! mpVerticalScrollBar)
@@ -218,6 +253,15 @@ void Deck::RequestLayout()
     DeckLayouter::LayoutDeck(GetContentArea(), mnMinimalWidth, maPanels,
                              *GetTitleBar(), *mpScrollClipWindow, *mpScrollContainer,
                              *mpFiller, *mpVerticalScrollBar);
+
+    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);
+    }
 }
 
 vcl::Window* Deck::GetPanelParentWindow()
@@ -264,6 +308,15 @@ 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)
commit ae2720ab206c2ff4a677e7fad147a3037f07a9be
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Dec 12 10:46:13 2018 -0500
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 25 09:29:37 2019 +0200

    sd: LOK: publish statechange on entering master view
    
    Change-Id: Ib736800544b9669e3708da0c01370af22cdf3e97
    Reviewed-on: https://gerrit.libreoffice.org/69617
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/73498
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 67a651122497..4fb136fa9838 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -441,6 +441,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
         GetViewFrame()->SetChildWindow(
             AnimationChildWindow::GetChildWindowId(), false );
 
+        if (comphelper::LibreOfficeKit::isActive())
+            GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                                       ".uno:SlideMasterPage=true");
         if (!mpActualPage)
         {
             // as long as there is no mpActualPage, take first
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 9cebd8c4f0d8..924b27aeb4bb 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/uno/Any.hxx>
 
 #include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <undo/undomanager.hxx>
 #include <vcl/waitobj.hxx>
 #include <svl/aeitem.hxx>
@@ -1064,6 +1065,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
         case SID_CLOSE_MASTER_VIEW:
         {
+            // Notify of disabling master view, which is enabled in DrawViewShell::ChangeEditMode.
+            if (comphelper::LibreOfficeKit::isActive())
+                GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                                           ".uno:SlideMasterPage=false");
+
             Broadcast (
                 ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
 


More information about the Libreoffice-commits mailing list