sw/source/uibase/shells/basesh.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f83c1353b94fc7dec79d05ac45c11f40f497261d
Author:     Miklos Vajna <[email protected]>
AuthorDate: Thu Jan 5 15:57:33 2023 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Jan 5 17:26:57 2023 +0000

    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 <[email protected]>
    Tested-by: Jenkins

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.

Reply via email to