summaryrefslogtreecommitdiff
path: root/editeng/source/editeng
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 09:20:17 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:35 -0400
commit0b80622beecc45388547598e56a960f5eebff57b (patch)
tree820ff1e01c2242c844caa5237c446af41cbef3df /editeng/source/editeng
parent6bda991914d6e0d08db1ec7f8b1fe80701a8b583 (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> (cherry picked from commit a6353d61d396b5b62cb82f4f28cc8399742c9772)
Diffstat (limited to 'editeng/source/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 57c4c215040c..fa17feb6fe70 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 f6e3ba9f5f4e..718d3733aba6 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);
}