Kaydet (Commit) f06a9ec1 authored tarafından Miklos Vajna's avatar Miklos Vajna

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.

(cherry picked from commit dacc616f)

Conflicts:
	sw/inc/drawdoc.hxx
	sw/source/core/draw/drawdoc.cxx

Change-Id: I660dcb54231a9d404bf80b4284003d119dae6a5c
üst 2aa91f0d
...@@ -42,6 +42,8 @@ public: ...@@ -42,6 +42,8 @@ public:
virtual ::com::sun::star::uno::Reference< virtual ::com::sun::star::uno::Reference<
::com::sun::star::embed::XStorage> GetDocumentStorage() const SAL_OVERRIDE; ::com::sun::star::embed::XStorage> GetDocumentStorage() const SAL_OVERRIDE;
/// Get the callback and callback data, previously given to registerLibreOfficeKitCallback().
void getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData);
/// For saving of rectangles as control-replacement for versions < 5.0. /// For saving of rectangles as control-replacement for versions < 5.0.
virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const SAL_OVERRIDE; virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const SAL_OVERRIDE;
......
...@@ -132,6 +132,12 @@ SdrLayerID SwDrawModel::GetControlExportLayerId( const SdrObject & ) const ...@@ -132,6 +132,12 @@ SdrLayerID SwDrawModel::GetControlExportLayerId( const SdrObject & ) const
return static_cast<SdrLayerID>(m_pDoc->getIDocumentDrawModelAccess().GetHeavenId()); return static_cast<SdrLayerID>(m_pDoc->getIDocumentDrawModelAccess().GetHeavenId());
} }
void SwDrawModel::getLibreOfficeKitCallback(LibreOfficeKitCallback& rCallback, void*& rLibreOfficeKitData)
{
rCallback = mpLibreOfficeKitCallback;
rLibreOfficeKitData = mpLibreOfficeKitData;
}
uno::Reference< uno::XInterface > SwDrawModel::createUnoModel() uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
{ {
uno::Reference< uno::XInterface > xModel; uno::Reference< uno::XInterface > xModel;
......
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx> #include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <comphelper/lok.hxx> #include <comphelper/lok.hxx>
#include <IDocumentDrawModelAccess.hxx>
#include <drawdoc.hxx>
namespace namespace
{ {
...@@ -531,6 +533,17 @@ void SwSidebarWin::InitControls() ...@@ -531,6 +533,17 @@ void SwSidebarWin::InitControls()
mpOutlinerView->SetAttribs(DefaultItem()); 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 //create Scrollbars
mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG); mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
mpVScrollbar->EnableNativeWidget(false); mpVScrollbar->EnableNativeWidget(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment