summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 09:20:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 09:23:58 +0000
commita6353d61d396b5b62cb82f4f28cc8399742c9772 (patch)
tree632652701d3b8629945f7d12385abadf8bb92dfb /editeng
parentff1edd625709dd8e140e31609158c59a6413f72e (diff)
editeng: imlement per-view LOK_CALLBACK_CURSOR_VISIBLE
Also assert that we don't try to invoke the model callback in editeng in the the view-callback case. Change-Id: I9f7b7d74da154ac8d0fe3404b7d8114008f74773 Reviewed-on: https://gerrit.libreoffice.org/26211 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx15
-rw-r--r--editeng/source/editeng/impedit.cxx2
2 files changed, 15 insertions, 2 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 51f3b6adf8cd..e203ed904bac 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -402,15 +402,26 @@ void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
pImpEditView->ShowCursor( bGotoCursor, bForceVisCursor );
if (comphelper::LibreOfficeKit::isActive())
- pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+ else
+ pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+ }
}
}
void EditView::HideCursor()
{
pImpEditView->GetCursor()->Hide();
+
if (comphelper::LibreOfficeKit::isActive())
- pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+ else
+ pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+ }
}
Pair EditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index c95aed4d4e4b..577aef8d1818 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -127,6 +127,8 @@ void ImpEditView::registerLibreOfficeKitCallback(OutlinerSearchable* pSearchable
void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const
{
+ // Per-view callbacks should always invoke ImpEditView::libreOfficeKitViewCallback().
+ assert(!comphelper::LibreOfficeKit::isViewCallback());
if (mpLibreOfficeKitSearchable)
mpLibreOfficeKitSearchable->libreOfficeKitCallback(nType, pPayload);
}