diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2021-02-24 00:59:17 +0530 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2021-02-24 15:36:53 +0100 |
commit | 01f86c59531b29cd06dd53a7a6e4556fb97cbb24 (patch) | |
tree | 059b069cd2e7dbad8a138d28beba4bdb0332fb9a | |
parent | cf22475a22d7839aace779262b34e8fd98a51afb (diff) |
avoid LOK text selection update when reference cell is in different tab
Change-Id: I511b9c5a27f97b6e14e9a844179c27a96997abe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111315
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
-rw-r--r-- | editeng/source/editeng/editview.cxx | 9 | ||||
-rw-r--r-- | include/editeng/editview.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 7f0a0bb7a809..5ae9c1770e64 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -415,11 +415,13 @@ vcl::Cursor* EditView::GetCursor() const return pImpEditView->pCursor.get(); } -void EditView::InsertText( const OUString& rStr, bool bSelect ) +void EditView::InsertText( const OUString& rStr, bool bSelect, bool bLOKShowSelect ) { EditEngine* pEE = pImpEditView->pEditEngine; - pImpEditView->DrawSelectionXOR(); + + if (bLOKShowSelect) + pImpEditView->DrawSelectionXOR(); EditPaM aPaM1; if ( bSelect ) @@ -441,7 +443,8 @@ void EditView::InsertText( const OUString& rStr, bool bSelect ) else pImpEditView->SetEditSelection( EditSelection( aPaM2, aPaM2 ) ); - pEE->FormatAndUpdate( this ); + if (bLOKShowSelect) + pEE->FormatAndUpdate( this ); } bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * pFrameWin ) diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 05e59a4753fd..3876a9a75d05 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -222,7 +222,7 @@ public: vcl::Cursor* GetCursor() const; - void InsertText( const OUString& rNew, bool bSelect = false ); + void InsertText( const OUString& rNew, bool bSelect = false , bool bLOKShowSelect = true); void InsertParaBreak(); bool PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * pFrameWin = nullptr ); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 7465205fa089..540d342728ac 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3473,13 +3473,16 @@ void ScInputHandler::SetReference( const ScRange& rRef, const ScDocument& rDoc ) else aRefStr = rRef.Format(rDoc, ScRefFlags::VALID, aAddrDetails); } + bool bLOKShowSelect = true; + if(comphelper::LibreOfficeKit::isActive() && pRefViewSh->GetViewData().GetRefTabNo() != pRefViewSh->GetViewData().GetTabNo()) + bLOKShowSelect = false; if (pTableView || pTopView) { if (pTableView) - pTableView->InsertText( aRefStr, true ); + pTableView->InsertText( aRefStr, true, bLOKShowSelect ); if (pTopView) - pTopView->InsertText( aRefStr, true ); + pTopView->InsertText( aRefStr, true, bLOKShowSelect ); DataChanged(); } |