summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-10 16:42:00 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-10 15:15:06 +0000
commit89bbd0ecbf18a1e9030e49443fa15d068b19f767 (patch)
tree44cfc6a0e633f7cf2ca20c6e1c96f3a1f91107b0 /include
parent30104ff4c76b7f31450f525b4a6d7ebad9823aad (diff)
editeng: implement per-view LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
Given that the per-view callback is in SfxViewShell, and editeng doesn't depend on sfx2, add an interface class in editeng to invert the dependency. With this, gtktiledviewer no longer crashes when starting editeng text edit with per-view callbacks. Change-Id: I783cdc646b890a6b597000f1d88428c8042417cf Reviewed-on: https://gerrit.libreoffice.org/26169 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editview.hxx5
-rw-r--r--include/editeng/outliner.hxx15
-rw-r--r--include/sfx2/viewsh.hxx5
3 files changed, 21 insertions, 4 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 163ea7c6653c..909b656594c5 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -36,6 +36,7 @@ class EditEngine;
class ImpEditEngine;
class ImpEditView;
class OutlinerSearchable;
+class OutlinerViewCallable;
class SvxSearchItem;
class SvxFieldItem;
namespace vcl { class Window; }
@@ -182,8 +183,10 @@ public:
void SetBackgroundColor( const Color& rColor );
Color GetBackgroundColor() const;
- /// @see vcl::ITiledRenderable::registerCallback().
+ /// Register a LOK model callback.
void registerLibreOfficeKitCallback(OutlinerSearchable *pSearchable);
+ /// Register a LOK view callback.
+ void registerLibreOfficeKitViewCallback(OutlinerViewCallable *pCallable);
void SetControlWord( EVControlBits nWord );
EVControlBits GetControlWord() const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 8b71ae12805b..0220397a0df3 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -73,6 +73,7 @@ class SvxForbiddenCharactersTable;
class OverflowingText;
class NonOverflowingText;
class OutlinerSearchable;
+class OutlinerViewCallable;
namespace svl
{
@@ -269,8 +270,10 @@ public:
void SetBackgroundColor( const Color& rColor );
Color GetBackgroundColor();
- /// @see vcl::ITiledRenderable::registerCallback().
+ /// Registers a LOK model callback.
void registerLibreOfficeKitCallback(OutlinerSearchable* pSearchable);
+ /// Registers a LOK view callback.
+ void registerLibreOfficeKitViewCallback(OutlinerViewCallable* pCallable);
SfxItemSet GetAttribs();
@@ -381,6 +384,16 @@ public:
virtual void libreOfficeKitCallback(int nType, const char* pPayload) const = 0;
};
+/// Interface class to not depend on SfxViewShell in editeng, meant to replace OutlinerSearchable at the end.
+class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI OutlinerViewCallable
+{
+public:
+ virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const = 0;
+
+protected:
+ ~OutlinerViewCallable() throw () {}
+};
+
// some thesaurus functionality to avoid code duplication in different projects...
bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext( OUString &rStatusVal, LanguageType &rLang, const EditView &rEditView );
void EDITENG_DLLPUBLIC ReplaceTextWithSynonym( EditView &rEditView, const OUString &rSynonmText );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 936df3814cdf..7ed08c11c11c 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -40,6 +40,7 @@
#include <vcl/vclptr.hxx>
#include <sfx2/tabdlg.hxx>
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
+#include <editeng/outliner.hxx>
#include <functional>
class SfxBaseController;
@@ -140,7 +141,7 @@ template<class T> bool checkSfxViewShell(const SfxViewShell* pShell)
return dynamic_cast<const T*>(pShell) != nullptr;
}
-class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
+class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener, public OutlinerViewCallable
{
#ifdef INCLUDED_SFX2_VIEWSH_HXX
friend class SfxViewFrame;
@@ -325,7 +326,7 @@ public:
/// The actual per-view implementation of lok::Document::registerCallback().
void registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
/// Invokes the registered callback, if there are any.
- void libreOfficeKitViewCallback(int nType, const char* pPayload) const;
+ void libreOfficeKitViewCallback(int nType, const char* pPayload) const override;
};