diff options
Diffstat (limited to 'editeng/source/editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 5 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 19 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 4 |
3 files changed, 26 insertions, 2 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 5d64e4f81b93..51d9cd42d3b9 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -598,6 +598,11 @@ void EditView::RegisterViewShell(OutlinerViewShell* pViewShell) pImpEditView->RegisterViewShell(pViewShell); } +void EditView::RegisterOtherShell(OutlinerViewShell* pOtherShell) +{ + pImpEditView->RegisterOtherShell(pOtherShell); +} + void EditView::SetControlWord( EVControlBits nWord ) { pImpEditView->nControl = nWord; 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; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index b910da6f041d..a1430c601077 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -224,6 +224,8 @@ private: Color* pBackgroundColor; /// Containing view shell, if any. OutlinerViewShell* mpViewShell; + /// An other shell, just listening to our state, if any. + OutlinerViewShell* mpOtherShell; EditEngine* pEditEngine; VclPtr<vcl::Window> pOutWin; Pointer* pPointer; @@ -371,6 +373,8 @@ public: /// Informs this edit view about which view shell contains it. void RegisterViewShell(OutlinerViewShell* pViewShell); const OutlinerViewShell* GetViewShell() const; + /// Informs this edit view about which other shell listens to it. + void RegisterOtherShell(OutlinerViewShell* pViewShell); bool IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong ); OUString SpellIgnoreWord(); |