summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/crsrsh.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 /sw/source/core/crsr/crsrsh.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 'sw/source/core/crsr/crsrsh.cxx')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx23
1 files changed, 17 insertions, 6 deletions
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 <comphelper/lok.hxx>
#include <sfx2/lokhelper.hxx>
#include <comphelper/string.hxx>
+#include <editeng/editview.hxx>
#include <PostItMgr.hxx>
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<SdrView*>(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