From d45b6561ef5a229669b50c65f15c42d47e034434 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Wed, 3 Jun 2020 17:27:28 +0530 Subject: lokit: Avoid sending wrong edit-cursor/selection messages when... the EditView's output-area needs to be tweaked temporarily to render it to a tile which is meant for another view. Change-Id: I2b8fc1986c247ce65c18ea64e3b43d25625c7e9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98129 Tested-by: Jenkins Reviewed-by: Dennis Francis --- editeng/source/editeng/editview.cxx | 10 ++++++++++ editeng/source/editeng/impedit.cxx | 5 +++-- editeng/source/editeng/impedit.hxx | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 4a8b6873946d..9da4d6cbf8d5 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1602,4 +1602,14 @@ bool EditView::HasLOKSpecialPositioning() const return pImpEditView->HasLOKSpecialPositioning(); } +void EditView::SupressLOKMessages(bool bSet) +{ + pImpEditView->SupressLOKMessages(bSet); +} + +bool EditView::IsSupressLOKMessages() const +{ + return pImpEditView->IsSupressLOKMessages(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index efc1dee49b63..43165fefc1a0 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -190,7 +190,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo eSelectionMode(EESelectionMode::Std), eAnchorMode(EEAnchorMode::TopLeft), mpEditViewCallbacks(nullptr), - mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive()) + mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive()), + mbSupressLOKMessages(false) { aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM(); aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM(); @@ -1259,7 +1260,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) GetCursor()->SetSize( aCursorSz ); - if (comphelper::LibreOfficeKit::isActive() && mpViewShell) + if (comphelper::LibreOfficeKit::isActive() && mpViewShell && !mbSupressLOKMessages) { Point aPos = GetCursor()->GetPos(); boost::property_tree::ptree aMessageParams; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 0e2b6df1d790..18e1ea9f9308 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -302,7 +302,8 @@ private: // repaints of the EditView(s) const EditViewCallbacks* mpEditViewCallbacks; std::unique_ptr mpLOKSpecialPositioning; - bool mbBroadcastLOKViewCursor; + bool mbBroadcastLOKViewCursor:1; + bool mbSupressLOKMessages:1; const EditViewCallbacks* getEditViewCallbacks() const { @@ -462,6 +463,9 @@ public: void SetLOKSpecialVisArea(const tools::Rectangle& rVisArea); tools::Rectangle GetLOKSpecialVisArea() const; bool HasLOKSpecialPositioning() const; + + void SupressLOKMessages(bool bSet) { mbSupressLOKMessages = bSet; } + bool IsSupressLOKMessages() const { return mbSupressLOKMessages; } }; -- cgit