From 4d9bb7120a2ca27207b30d81d77a810a306fbe04 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 13 Sep 2016 16:48:05 +0200 Subject: 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 --- sw/source/core/crsr/crsrsh.cxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'sw/source/core/crsr/crsrsh.cxx') diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index d88d21c52c02..44776817a9d4 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -66,6 +66,7 @@ #include #include #include +#include #include using namespace com::sun::star; @@ -1226,13 +1227,23 @@ OUString SwCursorShell::getPageRectangles() void SwCursorShell::NotifyCursor(SfxViewShell* pOtherShell) const { - // Cursor position and visibility. - m_pVisibleCursor->_SetPosAndShow(pOtherShell); - // Text selection. - m_pCurrentCursor->Show(pOtherShell); - // Graphic selection. auto pView = const_cast(GetDrawView()); - pView->AdjustMarkHdl(pOtherShell); + if (pView->GetTextEditObject()) + { + EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); + rEditView.RegisterOtherShell(pOtherShell); + rEditView.ShowCursor(); + rEditView.RegisterOtherShell(nullptr); + } + else + { + // Cursor position and visibility. + m_pVisibleCursor->_SetPosAndShow(pOtherShell); + // Text selection. + m_pCurrentCursor->Show(pOtherShell); + // Graphic selection. + pView->AdjustMarkHdl(pOtherShell); + } } /// go to the next SSelection -- cgit v1.2.3