Blame SOURCES/0329-sw-lok-comments-fix-callback-of-newly-created-outlin.patch

f325b2
From d82649ea6f8232d52e1fe4e48ad6ccf1668418a8 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Sat, 14 Nov 2015 11:06:08 +0100
f325b2
Subject: [PATCH 329/398] sw lok comments: fix callback of newly created
f325b2
 outliner views
f325b2
f325b2
SwPostItMgr::registerLibreOfficeKitCallback() already took care of
f325b2
informing existing outliners, this commit gives a callback to newly
f325b2
registered ones as well.
f325b2
f325b2
(cherry picked from commit dacc616f7020d045a1cfdb3806436e06046dae10)
f325b2
f325b2
Change-Id: I660dcb54231a9d404bf80b4284003d119dae6a5c
f325b2
---
f325b2
 sw/inc/drawdoc.hxx                    |  2 ++
f325b2
 sw/source/core/draw/drawdoc.cxx       |  6 ++++++
f325b2
 sw/source/uibase/docvw/SidebarWin.cxx | 13 +++++++++++++
f325b2
 3 files changed, 21 insertions(+)
f325b2
f325b2
diff --git a/sw/inc/drawdoc.hxx b/sw/inc/drawdoc.hxx
f325b2
index bad9c0ca41a1..bbf079911656 100644
f325b2
--- a/sw/inc/drawdoc.hxx
f325b2
+++ b/sw/inc/drawdoc.hxx
f325b2
@@ -42,6 +42,8 @@ public:
f325b2
 
f325b2
     virtual ::com::sun::star::uno::Reference<
f325b2
                 ::com::sun::star::embed::XStorage> GetDocumentStorage() const SAL_OVERRIDE;
f325b2
+    /// Get the callback and callback data, previously given to registerLibreOfficeKitCallback().
f325b2
+    void getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData);
f325b2
 
f325b2
     /// For saving of rectangles as control-replacement for versions < 5.0.
f325b2
     virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const SAL_OVERRIDE;
f325b2
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
f325b2
index efd0bb1f163d..7f352c981890 100644
f325b2
--- a/sw/source/core/draw/drawdoc.cxx
f325b2
+++ b/sw/source/core/draw/drawdoc.cxx
f325b2
@@ -126,6 +126,12 @@ uno::Reference<embed::XStorage> SwDrawModel::GetDocumentStorage() const
f325b2
     return m_pDoc->GetDocStorage();
f325b2
 }
f325b2
 
f325b2
+void SwDrawModel::getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData)
f325b2
+{
f325b2
+    rCallback = mpLibreOfficeKitCallback;
f325b2
+    rLibreOfficeKitData = mpLibreOfficeKitData;
f325b2
+}
f325b2
+
f325b2
 SdrLayerID SwDrawModel::GetControlExportLayerId( const SdrObject & ) const
f325b2
 {
f325b2
     //for versions < 5.0, there was only Hell and Heaven
f325b2
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
index 721ef95e4acf..32d8b78815ae 100644
f325b2
--- a/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
@@ -82,6 +82,8 @@
f325b2
 #include <boost/scoped_ptr.hpp>
f325b2
 #include <memory>
f325b2
 #include <comphelper/lok.hxx>
f325b2
+#include <IDocumentDrawModelAccess.hxx>
f325b2
+#include <drawdoc.hxx>
f325b2
 
f325b2
 namespace
f325b2
 {
f325b2
@@ -532,6 +534,17 @@ void SwSidebarWin::InitControls()
f325b2
 
f325b2
     mpOutlinerView->SetAttribs(DefaultItem());
f325b2
 
f325b2
+    if (comphelper::LibreOfficeKit::isActive())
f325b2
+    {
f325b2
+        // If there is a callback already registered, inform the new outliner view about it.
f325b2
+        SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess()->GetDrawModel();
f325b2
+        LibreOfficeKitCallback pCallback = 0;
f325b2
+        void* pData = 0;
f325b2
+        pDrawModel->getLibreOfficeKitCallback(pCallback, pData);
f325b2
+        mpOutlinerView->setTiledRendering(mrView.GetWrtShellPtr()->isTiledRendering());
f325b2
+        mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData);
f325b2
+    }
f325b2
+
f325b2
     //create Scrollbars
f325b2
     mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
f325b2
     mpVScrollbar->EnableNativeWidget(false);
f325b2
-- 
f325b2
2.12.0
f325b2