summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-13 16:48:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-14 10:11:29 +0200
commit4d9bb7120a2ca27207b30d81d77a810a306fbe04 (patch)
tree891606d0e2a8eaf6079d183cb477c2aa06b0a8cd /editeng/source/editeng/impedit.cxx
parentac5f21587c09f700c1cbbe33ed73edfcc53ed666 (diff)
sw draw text: emit LOK_CALLBACK_INVALIDATE_VIEW_CURSOR from registerCallback()
With this, in case the first view has an active text edit and a new view is created, then the cursor position is instantly visible in the second view, even if the first view's cursor does not move later. (cherry picked from commit 586789fe757c0eb350c360a49cf90431a0bd5b24) Conflicts: sw/source/core/crsr/crsrsh.cxx Change-Id: Ia82e7dc1ce9bb58c67a280179ecadc74d3b63026
Diffstat (limited to 'editeng/source/editeng/impedit.cxx')
-rw-r--r--editeng/source/editeng/impedit.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 795a82453ef8..3fa2b5111d37 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -80,6 +80,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo
pPointer = nullptr;
pBackgroundColor = nullptr;
mpViewShell = nullptr;
+ mpOtherShell = nullptr;
nScrollDiffX = 0;
nExtraCursorFlags = 0;
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
@@ -122,6 +123,11 @@ void ImpEditView::RegisterViewShell(OutlinerViewShell* pViewShell)
mpViewShell = pViewShell;
}
+void ImpEditView::RegisterOtherShell(OutlinerViewShell* pOtherShell)
+{
+ mpOtherShell = pOtherShell;
+}
+
const OutlinerViewShell* ImpEditView::GetViewShell() const
{
return mpViewShell;
@@ -1004,8 +1010,17 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
aRect.setWidth(0);
OString sRect = aRect.toString();
- mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
- mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+ if (mpOtherShell)
+ {
+ // An other shell wants to know about our existing cursor.
+ if (mpViewShell != mpOtherShell)
+ mpViewShell->NotifyOtherView(mpOtherShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+ }
+ else
+ {
+ mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
+ mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+ }
}
CursorDirection nCursorDir = CursorDirection::NONE;