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 85a64197f86b77e295b9ddfc81abf1aca4aad47d Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Feb 8 19:52:35 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Feb 9 07:34:01 2023 +0000 sw: fix undo comment of FN_UPDATE_TEXT_FORMFIELD It's an update, not an insert. One has to dispatch .uno:TextFormField, then move inside the formfield with the cursor finally dispatch .uno:UpdateTextFormField to see this in action. Change-Id: Id9e3c7b9d08582cbf83f64ff04c97dff5cbb88f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146671 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index e6927179b875..af916bf78422 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -588,6 +588,7 @@ #define STR_UNDO_TBLSTYLE_UPDATE NC_("STR_UNDO_TBLSTYLE_UPDATE", "Update table style: $1") #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_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 7e9e0108b71f..6b067dbec700 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -167,6 +167,7 @@ enum class SwUndoId INSERT_FORM_FIELD, // 135 OUTLINE_EDIT, // 136 INSERT_PAGE_NUMBER, // 137 + UPDATE_FORM_FIELD, // 138 }; OUString GetUndoComment(SwUndoId eId); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index b4ecde1d52bd..0f12d8ef96d0 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -646,6 +646,9 @@ OUString GetUndoComment(SwUndoId eId) case SwUndoId::INSERT_PAGE_NUMBER: pId = STR_UNDO_INSERT_PAGE_NUMBER; break; + case SwUndoId::UPDATE_FORM_FIELD: + pId = STR_UNDO_UPDATE_FORM_FIELD; + break; } assert(pId); diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index a70d3c248c7d..a71ca8702f2f 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -1152,7 +1152,7 @@ FIELD_INSERT: break; } - rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_FORM_FIELD, nullptr); + rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_FORM_FIELD, nullptr); rSh.StartAction(); comphelper::SequenceAsHashMap aMap(aField); itParam->second = aMap["FieldCommand"]; @@ -1168,7 +1168,7 @@ FIELD_INSERT: SwTranslateHelper::PasteHTMLToPaM(rSh, &aPaM, aFieldResult.toUtf8(), true); rSh.EndAction(); - rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_FORM_FIELD, nullptr); + rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_FORM_FIELD, nullptr); } break; default: