[Libreoffice-commits] core.git: editeng/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jun 13 09:24:25 UTC 2016
editeng/source/editeng/editview.cxx | 15 +++++++++++++--
editeng/source/editeng/impedit.cxx | 2 ++
2 files changed, 15 insertions(+), 2 deletions(-)
New commits:
commit a6353d61d396b5b62cb82f4f28cc8399742c9772
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 13 09:20:17 2016 +0200
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 51f3b6a..e203ed9 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 c95aed4..577aef8 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);
}
More information about the Libreoffice-commits
mailing list