diff options
Diffstat (limited to 'sw/source/core/crsr/viscrs.cxx')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 2c0ca9e2073e..b9e9d012109d 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -95,7 +95,7 @@ void SwVisibleCursor::Show() // display at all? if( m_pCursorShell->VisArea().IsOver( m_pCursorShell->m_aCharRect ) || comphelper::LibreOfficeKit::isActive() ) - _SetPosAndShow(); + _SetPosAndShow(nullptr); } } @@ -110,7 +110,7 @@ void SwVisibleCursor::Hide() } } -void SwVisibleCursor::_SetPosAndShow() +void SwVisibleCursor::_SetPosAndShow(SfxViewShell* pViewShell) { SwRect aRect; long nTmpY = m_pCursorShell->m_aCursorHeight.getY(); @@ -199,8 +199,18 @@ void SwVisibleCursor::_SetPosAndShow() // notify about the cursor position & size Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height()); OString sRect = aSVRect.toString(); - m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); - SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); + if (pViewShell) + { + if (pViewShell == m_pCursorShell->GetSfxViewShell()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); + else + SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); + } + else + { + m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); + SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); + } } if ( !m_pCursorShell->IsCursorReadonly() || m_pCursorShell->GetViewOptions()->IsSelectionInReadonly() ) |