From 77235ac64be61afd707931675fec100c7c50d01c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 16 Aug 2016 12:34:12 +0200 Subject: editeng: introduce OutlinerViewShell::NotifyOtherViews() This allows notifying other views about e.g. cursor position changes even if SfxLokHelper::notifyOtherViews() is not accessible from editeng. Change-Id: I921e97344ffe562109a221f241e70b3f68ee9aaf Reviewed-on: https://gerrit.libreoffice.org/28162 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- editeng/source/editeng/editview.cxx | 8 ++++++-- editeng/source/editeng/impedit.cxx | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'editeng') diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index f00678fa091e..49aeaf23ff09 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -403,7 +403,9 @@ void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivat if (pImpEditView->mpViewShell && !bActivate) { - pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); + OString aPayload = OString::boolean(true); + pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr()); + pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", aPayload); } } } @@ -414,7 +416,9 @@ void EditView::HideCursor(bool bDeactivate) if (pImpEditView->mpViewShell && !bDeactivate) { - pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); + OString aPayload = OString::boolean(false); + pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr()); + pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", aPayload); } } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 13a53acfc0f7..2ef02909e6ee 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -408,6 +408,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou } mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr()); + mpViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRectangle); pOutWin->Pop(); } @@ -1005,6 +1006,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) OString sRect = aRect.toString(); mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); + mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); } CursorDirection nCursorDir = CursorDirection::NONE; -- cgit