editeng/source/editeng/editview.cxx | 4 ++-- editeng/source/editeng/impedit.cxx | 4 ++-- editeng/source/editeng/impedit.hxx | 4 ++-- editeng/source/editeng/impedit2.cxx | 8 ++++++-- editeng/source/outliner/outlvw.cxx | 6 ++---- include/editeng/editview.hxx | 2 +- include/editeng/outliner.hxx | 2 +- include/vcl/seleng.hxx | 2 +- svx/source/dialog/weldeditview.cxx | 3 +-- vcl/source/window/seleng.cxx | 7 ++++--- 10 files changed, 22 insertions(+), 20 deletions(-)
New commits: commit 2a91637ed9a312471afe7a2201371eb9ae7f33c7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Dec 18 10:46:03 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Dec 18 21:39:05 2020 +0100 add a return to EditView::Command to indicate if the command was consumed Change-Id: I971fcfb77d93d7d1146443a8ec30d9159746bd89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107960 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 7b70f98b6ef7..a17f76d6d492 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -471,9 +471,9 @@ bool EditView::MouseMove( const MouseEvent& rMouseEvent ) return pImpEditView->MouseMove( rMouseEvent ); } -void EditView::Command( const CommandEvent& rCEvt ) +bool EditView::Command(const CommandEvent& rCEvt) { - pImpEditView->Command( rCEvt ); + return pImpEditView->Command(rCEvt); } void EditView::SetBroadcastLOKViewCursor(bool bSet) diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 20dce95424a9..bd2f0bf24218 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1705,10 +1705,10 @@ bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent ) return pEditEngine->pImpEditEngine->MouseMove( rMouseEvent, GetEditViewPtr() ); } -void ImpEditView::Command( const CommandEvent& rCEvt ) +bool ImpEditView::Command(const CommandEvent& rCEvt) { pEditEngine->CheckIdleFormatter(); // If fast typing and mouse button down - pEditEngine->pImpEditEngine->Command( rCEvt, GetEditViewPtr() ); + return pEditEngine->pImpEditEngine->Command(rCEvt, GetEditViewPtr()); } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 45088dc9bedf..a874a51699e3 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -368,7 +368,7 @@ public: bool MouseButtonDown( const MouseEvent& rMouseEvent ); void ReleaseMouse(); bool MouseMove( const MouseEvent& rMouseEvent ); - void Command( const CommandEvent& rCEvt ); + bool Command(const CommandEvent& rCEvt); void CutCopy( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bCut ); void Paste( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bUseSpecial = false ); @@ -841,7 +841,7 @@ public: bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView ); void ReleaseMouse(); bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); - void Command( const CommandEvent& rCEvt, EditView* pView ); + bool Command(const CommandEvent& rCEvt, EditView* pView); EditSelectionEngine& GetSelEngine() { return aSelEngine; } OUString GetSelected( const EditSelection& rSel ) const; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 2c83c1165856..d2596ebd9065 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -331,8 +331,10 @@ bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) return true; } -void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) +bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) { + bool bConsumed = true; + GetSelEngine().SetCurView( pView ); SetActiveView( pView ); if ( rCEvt.GetCommand() == CommandEventId::StartExtTextInput ) @@ -555,8 +557,10 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) } } } + else + bConsumed = false; - GetSelEngine().Command( rCEvt ); + return GetSelEngine().Command(rCEvt) || bConsumed; } bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index aff9992d8b4c..8ba3a28c87f0 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -773,13 +773,11 @@ void OutlinerView::ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_In pOwner->ImpTextPasted( nStart, nSize ); } - -void OutlinerView::Command( const CommandEvent& rCEvt ) +bool OutlinerView::Command(const CommandEvent& rCEvt) { - pEditView->Command( rCEvt ); + return pEditView->Command(rCEvt); } - void OutlinerView::SelectRange( sal_Int32 nFirst, sal_Int32 nCount ) { sal_Int32 nLast = nFirst+nCount; diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 7189f40d63ff..ae6ebd521a2a 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -228,7 +228,7 @@ public: bool MouseButtonDown( const MouseEvent& rMouseEvent ); void ReleaseMouse(); bool MouseMove( const MouseEvent& rMouseEvent ); - void Command( const CommandEvent& rCEvt ); + bool Command(const CommandEvent& rCEvt); void Cut(); void Copy(); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index a6bc9fbd7ff2..0ffa5721c203 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -276,7 +276,7 @@ public: EEAnchorMode GetAnchorMode() const; PointerStyle GetPointer( const Point& rPosPixel ); - void Command( const CommandEvent& rCEvt ); + bool Command(const CommandEvent& rCEvt); void StartSpeller(); EESpellState StartThesaurus(); diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx index 92c69d14701d..4db64c49b280 100644 --- a/include/vcl/seleng.hxx +++ b/include/vcl/seleng.hxx @@ -143,7 +143,7 @@ public: bool IsInSelection() const; void Reset(); - void Command( const CommandEvent& rCEvt ); + bool Command(const CommandEvent& rCEvt); bool HasAnchor() const; void SetAnchor( bool bAnchor ); diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index d14afb6dfec4..376b4cfba9e2 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -232,8 +232,7 @@ bool WeldEditView::Command(const CommandEvent& rCEvt) EditView* pEditView = GetEditView(); if (!pEditView) return false; - pEditView->Command(rCEvt); - return true; + return pEditView->Command(rCEvt); } class WeldEditAccessible; diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index f4eaeef726cc..017ae30b8062 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -355,14 +355,14 @@ void SelectionEngine::Reset() nLockedMods = 0; } -void SelectionEngine::Command( const CommandEvent& rCEvt ) +bool SelectionEngine::Command( const CommandEvent& rCEvt ) { // Timer aWTimer is active during enlarging a selection if ( !pFunctionSet || aWTimer.IsActive() ) - return; + return false; aWTimer.Stop(); if ( rCEvt.GetCommand() != CommandEventId::StartDrag ) - return; + return false; nFlags |= SelectionEngineFlags::CMDEVT; if ( nFlags & SelectionEngineFlags::DRG_ENAB ) @@ -382,6 +382,7 @@ void SelectionEngine::Command( const CommandEvent& rCEvt ) } else nFlags &= ~SelectionEngineFlags::CMDEVT; + return true; } void SelectionEngine::SetUpdateInterval( sal_uLong nInterval ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits