diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-01-12 11:35:02 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-02-11 12:10:55 +0000 |
commit | f7afed99a807a9ce42edf84cab36a4710ddcd58e (patch) | |
tree | 9d0443f94bc921b12fe5016ce42a960367522b0f /sw/source/uibase/shells | |
parent | c217359b7b3583ae4156e4c2322fe7d867eb3306 (diff) |
sw: rename getFieldmarkFor() to getInnerFieldmarkFor()
The same change was made for getBookmarkFor()
in https://gerrit.libreoffice.org/c/core/+/145412
Because otherwise it's quite confusing
that we have a For() and an At()
which could only be differentiated by a code read.
Also improve getInnerFieldmarkFor() a tiny bit,
so we process the first hit only once.
Suggested at
<https://gerrit.libreoffice.org/c/core/+/145348/1#message-286262286f234823b390e8f962e3ba11f5fa71b2>.
Change-Id: I47e815eea0b8ac0df4957ac0d224acb6c5975b8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145486
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/uibase/shells')
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index a71ca8702f2f..b60df6477bf5 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -1128,7 +1128,7 @@ FIELD_INSERT: IDocumentMarkAccess& rIDMA = *rSh.getIDocumentMarkAccess(); SwPosition& rCursor = *rSh.GetCursor()->GetPoint(); - sw::mark::IFieldmark* pFieldmark = rIDMA.getFieldmarkFor(rCursor); + sw::mark::IFieldmark* pFieldmark = rIDMA.getInnerFieldmarkFor(rCursor); if (!pFieldmark) { break; @@ -1353,12 +1353,12 @@ void SwTextShell::StateField( SfxItemSet &rSet ) { // Check whether we are in a text form field SwPosition aCursorPos(*rSh.GetCursor()->GetPoint()); - sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aCursorPos); + sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aCursorPos); if ((!pFieldBM || pFieldBM->GetFieldname() != ODF_FORMTEXT) && aCursorPos.GetContentIndex() > 0) { SwPosition aPos(*aCursorPos.GetContentNode(), aCursorPos.GetContentIndex() - 1); - pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos); + pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPos); } if (pFieldBM && pFieldBM->GetFieldname() == ODF_FORMTEXT && (aCursorPos > pFieldBM->GetMarkStart() && aCursorPos < pFieldBM->GetMarkEnd() )) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 3ef16213576c..96c48c7df072 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1885,11 +1885,11 @@ void SwTextShell::Execute(SfxRequest &rReq) case SID_FM_CTL_PROPERTIES: { SwPosition aPos(*GetShell().GetCursor()->GetPoint()); - sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos); + sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPos); if ( !pFieldBM ) { aPos.AdjustContent(-1); - pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos); + pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPos); } if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN @@ -2718,11 +2718,11 @@ void SwTextShell::GetState( SfxItemSet &rSet ) // Enable it if we have a valid object other than what form shell knows SwPosition aPos(*GetShell().GetCursor()->GetPoint()); - sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos); + sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPos); if ( !pFieldBM && aPos.GetContentIndex() > 0) { aPos.AdjustContent(-1); - pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos); + pFieldBM = GetShell().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPos); } if ( pFieldBM && (pFieldBM->GetFieldname() == ODF_FORMDROPDOWN || pFieldBM->GetFieldname() == ODF_FORMDATE) ) { |