diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 5 |
3 files changed, 24 insertions, 4 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 4b2bb2398506..d0da7829cb09 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1224,6 +1224,11 @@ OUString SwCursorShell::getPageRectangles() return OUString::fromUtf8(comphelper::string::join("; ", v).getStr()); } +void SwCursorShell::NotifyCursor(SfxViewShell* pViewShell) const +{ + m_pVisibleCursor->_SetPosAndShow(pViewShell); +} + /// go to the next SSelection bool SwCursorShell::GoNextCursor() { 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() ) diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 00f0f5bcad13..072478439803 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -279,6 +279,11 @@ const OUString& SwView::GetRedlineAuthor() return m_pViewImpl->m_sRedlineAuthor; } +void SwView::NotifyCursor(SfxViewShell* pViewShell) const +{ + m_pWrtShell->NotifyCursor(pViewShell); +} + // Create page printer/additions for SwView and SwPagePreview VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, |