summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-18 10:46:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-18 21:39:05 +0100
commit2a91637ed9a312471afe7a2201371eb9ae7f33c7 (patch)
treef5b0aae15bab1392bcaaad7f59fdb79bb36f4ebc /editeng
parent0d6063a61c15688998c1a7f865b090fd9b1f8fff (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx4
-rw-r--r--editeng/source/editeng/impedit.hxx4
-rw-r--r--editeng/source/editeng/impedit2.cxx8
-rw-r--r--editeng/source/outliner/outlvw.cxx6
5 files changed, 14 insertions, 12 deletions
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;