diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-01-05 15:57:33 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-01-05 17:26:57 +0000 |
commit | f83c1353b94fc7dec79d05ac45c11f40f497261d (patch) | |
tree | 52c4ff3bd9bff5691c6fcbb02ff59ac3468a4847 | |
parent | 0461eb7564236b8a427fe677658705e9955a8d13 (diff) |
sw: UpdateFieldContents: fix typos
- The function name itself had a typo, spotted at
<https://gerrit.libreoffice.org/c/core/+/145036/2#message-d8cb4de7de483866e0c86c8919cdf47f84b6037e>.
- Also, if the # of provided fields and # of fields we find in the
document don't match, we can give up, so no need to continue, the same
condition would fail again, anyway.
Change-Id: Ifbf7f60c86f469697056975752efc9d130287099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145083
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index bdd778270481..84fa44f2bc40 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -774,7 +774,7 @@ namespace { /// Searches for the specified field type and field name prefix and update the matching fields to /// have the provided new name and content. -bool UpdateFieldConents(SfxRequest& rReq, SwWrtShell& rWrtSh) +bool UpdateFieldContents(SfxRequest& rReq, SwWrtShell& rWrtSh) { const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1); if (!pTypeName || pTypeName->GetValue() != "SetRef") @@ -812,7 +812,7 @@ bool UpdateFieldConents(SfxRequest& rReq, SwWrtShell& rWrtSh) if (nFieldIndex >= aFields.getLength()) { - continue; + break; } comphelper::SequenceAsHashMap aMap(aFields[nFieldIndex++]); auto aName = aMap["Name"].get<OUString>(); @@ -889,7 +889,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) break; case FN_UPDATE_FIELDS: { - if (UpdateFieldConents(rReq, rSh)) + if (UpdateFieldContents(rReq, rSh)) { // Parameters indicated that the name / content of fields has to be updated to // the provided values, don't do an actual fields update. |