diff options
author | Justin Luth <jluth@mail.com> | 2023-11-06 16:53:50 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-11-15 20:05:38 +0100 |
commit | 32d0efa9d934ec45f2863a285d250dfc0ab137e8 (patch) | |
tree | decd6ec1639e71b9e80d5cf3b3c4305ca4cf4dc5 /editeng | |
parent | 33ec38c5333e0c71aa995292fbddc1a237979e32 (diff) |
tdf#158031 editeng: rename GetFieldAtCursor
because it doesn't really get the field at the cursor,
and certainly is not similar to SelectFieldAtCursor.
It first gets the field under the mouse.
Then, if there is a selection, it gets the selected field,
else it looks for the field on either side.
There were LOTS of places where it
probably had not been used properly.
Most of those are gone now, so it is easier
to rename the function.
Change-Id: I1a64af24092582cf865509d2a474080258edd76c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159022
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 2 | ||||
-rw-r--r-- | editeng/source/misc/urlfieldhelper.cxx | 3 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 5 |
3 files changed, 3 insertions, 7 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index e1229b6918db..81cc8bf1aa56 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1424,7 +1424,7 @@ void EditView::SelectFieldAtCursor() assert(std::abs(aSel.nStartPos - aSel.nEndPos) == 1); } -const SvxFieldData* EditView::GetFieldAtCursor(bool bAlsoCheckBeforeCursor) const +const SvxFieldData* EditView::GetFieldUnderMouseOrInSelectionOrAtCursor(bool bAlsoCheckBeforeCursor) const { const SvxFieldItem* pFieldItem = GetFieldUnderMousePointer(); if (!pFieldItem) diff --git a/editeng/source/misc/urlfieldhelper.cxx b/editeng/source/misc/urlfieldhelper.cxx index d60d7be92934..57f2a042c6b5 100644 --- a/editeng/source/misc/urlfieldhelper.cxx +++ b/editeng/source/misc/urlfieldhelper.cxx @@ -38,7 +38,8 @@ bool URLFieldHelper::IsCursorAtURLField(const EditView& pEditView, bool bAlsoChe if (!bIsValidSelection) return false; - const SvxFieldData* pField = pEditView.GetFieldAtCursor(bAlsoCheckBeforeCursor); + const SvxFieldData* pField + = pEditView.GetFieldUnderMouseOrInSelectionOrAtCursor(bAlsoCheckBeforeCursor); if (dynamic_cast<const SvxURLField*>(pField)) return true; diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 2649e865d6d7..136ecd776c26 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1345,11 +1345,6 @@ const SvxFieldItem* OutlinerView::GetFieldAtSelection(bool bAlsoCheckBeforeCurso return pEditView->GetFieldAtSelection(bAlsoCheckBeforeCursor); } -const SvxFieldData* OutlinerView::GetFieldAtCursor() const -{ - return pEditView->GetFieldAtCursor(); -} - void OutlinerView::SelectFieldAtCursor() { pEditView->SelectFieldAtCursor(); |