summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-14 11:06:08 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-14 13:40:35 +0100
commitdacc616f7020d045a1cfdb3806436e06046dae10 (patch)
tree1e954609f48bbbf69f40e9ae74edddbaba8c168f
parente320d070bb0d4dd0ceb696f2c7cc5afb7c4273c3 (diff)
sw lok comments: fix callback of newly created outliner views
SwPostItMgr::registerLibreOfficeKitCallback() already took care of informing existing outliners, this commit gives a callback to newly registered ones as well. Change-Id: I660dcb54231a9d404bf80b4284003d119dae6a5c
-rw-r--r--sw/inc/drawdoc.hxx2
-rw-r--r--sw/source/core/draw/drawdoc.cxx6
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx13
3 files changed, 21 insertions, 0 deletions
diff --git a/sw/inc/drawdoc.hxx b/sw/inc/drawdoc.hxx
index 339fbc7f9c3d..97efdb5f52bf 100644
--- a/sw/inc/drawdoc.hxx
+++ b/sw/inc/drawdoc.hxx
@@ -41,6 +41,8 @@ public:
virtual SdrPage* AllocPage(bool bMasterPage) override;
virtual css::uno::Reference<css::embed::XStorage> GetDocumentStorage() const override;
+ /// Get the callback and callback data, previously given to registerLibreOfficeKitCallback().
+ void getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData);
protected:
/// override of <SdrModel::createUnoModel()> is needed to provide corresponding uno model.
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 786d86f91d3a..4e295d71bc1b 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -129,6 +129,12 @@ uno::Reference<embed::XStorage> SwDrawModel::GetDocumentStorage() const
return m_pDoc->GetDocStorage();
}
+void SwDrawModel::getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData)
+{
+ rCallback = mpLibreOfficeKitCallback;
+ rLibreOfficeKitData = mpLibreOfficeKitData;
+}
+
uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
{
uno::Reference< uno::XInterface > xModel;
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index d1901f60b2dd..7449887284ef 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -81,6 +81,8 @@
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
#include <memory>
#include <comphelper/lok.hxx>
+#include <IDocumentDrawModelAccess.hxx>
+#include <drawdoc.hxx>
namespace
{
@@ -531,6 +533,17 @@ void SwSidebarWin::InitControls()
mpOutlinerView->SetAttribs(DefaultItem());
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // If there is a callback already registered, inform the new outliner view about it.
+ SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel();
+ LibreOfficeKitCallback pCallback = 0;
+ void* pData = 0;
+ pDrawModel->getLibreOfficeKitCallback(pCallback, pData);
+ mpOutlinerView->setTiledRendering(mrView.GetWrtShellPtr()->isTiledRendering());
+ mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData);
+ }
+
//create Scrollbars
mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
mpVScrollbar->EnableNativeWidget(false);