editeng/source/editeng/editview.cxx | 5 +++++ editeng/source/editeng/impedit.cxx | 14 ++++++++++++++ editeng/source/editeng/impedit.hxx | 8 ++++++++ editeng/source/outliner/outlvw.cxx | 5 +++++ include/editeng/editview.hxx | 4 ++++ include/editeng/outliner.hxx | 4 ++++ include/svx/svdmodel.hxx | 4 ++++ svx/source/svdraw/svdedxv.cxx | 1 + svx/source/svdraw/svdmodel.cxx | 10 ++++++++++ 9 files changed, 55 insertions(+)
New commits: commit ae80796e2641786416499c25ff845e4b93063af6 Author: Miklos Vajna <[email protected]> Date: Thu Mar 12 13:08:49 2015 +0100 Add ImpEditView::libreOfficeKitCallback() And various other methods, so that it's possible to invoke the callback in ImpEditView. This will be needed by the blinking editeng cursor. Change-Id: Ie1b6957e5c48f606e71d5808df3f632924d3a2ec diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index cfd4fc5..4db1892 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -582,6 +582,11 @@ bool EditView::isTiledRendering() return pImpEditView->isTiledRendering(); } +void EditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData) +{ + pImpEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData); +} + void EditView::SetControlWord( sal_uInt32 nWord ) { pImpEditView->nControl = nWord; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index ed543cb..633593b 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -76,6 +76,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo pPointer = NULL; pBackgroundColor = NULL; mbTiledRendering = false; + mpLibreOfficeKitCallback = 0; + mpLibreOfficeKitData = 0; nScrollDiffX = 0; nExtraCursorFlags = 0; nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW; @@ -123,6 +125,18 @@ bool ImpEditView::isTiledRendering() const return mbTiledRendering; } +void ImpEditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + mpLibreOfficeKitCallback = pCallback; + mpLibreOfficeKitData = pData; +} + +void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const +{ + if (mpLibreOfficeKitCallback) + mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); +} + void ImpEditView::SetEditSelection( const EditSelection& rEditSelection ) { // set state before notification diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 5ec289b..613d25e 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -52,6 +52,8 @@ #include <i18nlangtag/lang.h> #include <rtl/ref.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> #include <boost/noncopyable.hpp> @@ -217,6 +219,8 @@ private: vcl::Cursor* pCursor; Color* pBackgroundColor; bool mbTiledRendering; + LibreOfficeKitCallback mpLibreOfficeKitCallback; + void* mpLibreOfficeKitData; EditEngine* pEditEngine; vcl::Window* pOutWin; Pointer* pPointer; @@ -367,6 +371,10 @@ public: void setTiledRendering(bool bTiledRendering); bool isTiledRendering() const; + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + /// Invokes the registered callback, if there are any. + void libreOfficeKitCallback(int nType, const char* pPayload) const; bool IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong ); OUString SpellIgnoreOrAddWord( bool bAdd ); diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 9e61056..bd2b084 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1425,6 +1425,11 @@ void OutlinerView::setTiledRendering(bool bTiledRendering) pEditView->setTiledRendering(bTiledRendering); } +void OutlinerView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData) +{ + pEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData); +} + Color OutlinerView::GetBackgroundColor() { return pEditView->GetBackgroundColor(); diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 439f63b..97bd6a2 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -27,6 +27,8 @@ #include <tools/color.hxx> #include <tools/gen.hxx> #include <vcl/cursor.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> class EditEngine; class ImpEditEngine; @@ -171,6 +173,8 @@ public: void setTiledRendering(bool bTiledRendering); bool isTiledRendering(); + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); void SetControlWord( sal_uInt32 nWord ); sal_uInt32 GetControlWord() const; diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index ce25da0..441183c 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -36,6 +36,8 @@ #include <svtools/grfmgr.hxx> #include <tools/rtti.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> #include <vector> class OutlinerEditEng; @@ -268,6 +270,8 @@ public: /// Set if we are doing tiled rendering. void setTiledRendering(bool bTiledRendering); + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); SfxItemSet GetAttribs(); diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 8cd4541..3f61550 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -343,6 +343,10 @@ public: bool isTiledRendering() const; /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API. void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + /// Gets the LOK callback registered by registerLibreOfficeKitCallback(). + LibreOfficeKitCallback getLibreOfficeKitCallback() const; + /// Gets the LOK data registered by registerLibreOfficeKitCallback(). + void* getLibreOfficeKitData() const; /// Invokes the registered callback, if there are any. void libreOfficeKitCallback(int nType, const char* pPayload) const; // If a new MapMode is set on the RefDevice (or similar) diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 0625696..5cf1ca1 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -447,6 +447,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP pOutlView->SetControlWord(nStat); pOutlView->SetBackgroundColor( aBackground ); pOutlView->setTiledRendering(GetModel()->isTiledRendering()); + pOutlView->registerLibreOfficeKitCallback(GetModel()->getLibreOfficeKitCallback(), GetModel()->getLibreOfficeKitData()); if (pText!=NULL) { pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode())); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 66f004e..9e59338 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -820,6 +820,16 @@ void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); } +LibreOfficeKitCallback SdrModel::getLibreOfficeKitCallback() const +{ + return mpLibreOfficeKitCallback; +} + +void* SdrModel::getLibreOfficeKitData() const +{ + return mpLibreOfficeKitData; +} + void SdrModel::ImpReformatAllTextObjects() { if( isLocked() ) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
