sw/inc/strings.hrc                  |    1 +
 sw/inc/swundo.hxx                   |    1 +
 sw/source/core/undo/undobj.cxx      |    3 +++
 sw/source/uibase/shells/textfld.cxx |    4 ++--
 4 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 5543faac1b4a92455c9c8e9f081688411f4a0cc5
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Feb 15 20:13:35 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Feb 16 07:17:08 2023 +0000

    sw: fix undo comment of FN_UPDATE_TEXT_FORMFIELDS
    
    It's updates, not an insert. One has to dispatch .uno:TextFormFields to
    see this in action.
    
    Change-Id: I3049fa34110731e15082a0163de4b08e83c76098
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147109
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index af916bf78422..6c2119fb78dc 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -589,6 +589,7 @@
 #define STR_UNDO_TABLE_DELETE                   NC_("STR_UNDO_TABLE_DELETE", 
"Delete table")
 #define STR_UNDO_INSERT_FORM_FIELD              
NC_("STR_UNDO_INSERT_FORM_FIELD", "Insert form field")
 #define STR_UNDO_UPDATE_FORM_FIELD              
NC_("STR_UNDO_UPDATE_FORM_FIELD", "Update form field")
+#define STR_UNDO_UPDATE_FORM_FIELDS             
NC_("STR_UNDO_UPDATE_FORM_FIELDS", "Update form fields")
 #define STR_UNDO_INSERT_PAGE_NUMBER             
NC_("STR_UNDO_INSERT_PAGE_NUMBER", "Insert page number")
 #define STR_DROP_DOWN_FIELD_ITEM_LIMIT          
NC_("STR_DROP_DOWN_FIELD_ITEM_LIMIT", "You can specify maximum of 25 items for 
a drop-down form field.")
 
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 6b067dbec700..a387757bfd6b 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -168,6 +168,7 @@ enum class SwUndoId
     OUTLINE_EDIT,                      // 136
     INSERT_PAGE_NUMBER,                // 137
     UPDATE_FORM_FIELD,                 // 138
+    UPDATE_FORM_FIELDS,                // 139
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 0f12d8ef96d0..8a23ae1f03ff 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -649,6 +649,9 @@ OUString GetUndoComment(SwUndoId eId)
         case SwUndoId::UPDATE_FORM_FIELD:
             pId = STR_UNDO_UPDATE_FORM_FIELD;
             break;
+        case SwUndoId::UPDATE_FORM_FIELDS:
+            pId = STR_UNDO_UPDATE_FORM_FIELDS;
+            break;
     }
 
     assert(pId);
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index b60df6477bf5..02f6b8d29a63 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -917,7 +917,7 @@ FIELD_INSERT:
             pFields->GetValue() >>= aFields;
         }
 
-        
rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_FORM_FIELD, 
nullptr);
+        
rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_FORM_FIELDS, 
nullptr);
         rSh.StartAction();
 
         IDocumentMarkAccess* pMarkAccess = 
rSh.GetDoc()->getIDocumentMarkAccess();
@@ -964,7 +964,7 @@ FIELD_INSERT:
         }
 
         rSh.EndAction();
-        
rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_FORM_FIELD, 
nullptr);
+        
rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_FORM_FIELDS, 
nullptr);
     }
     break;
     case FN_DELETE_TEXT_FORMFIELDS:

Reply via email to