sw/inc/strings.hrc | 1 + sw/inc/swundo.hxx | 1 + sw/source/core/undo/undobj.cxx | 3 +++ sw/source/uibase/shells/textsh1.cxx | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit 95eb99866b3ac1a1639d3399f42f82a0670eb23a Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Apr 12 20:09:20 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Apr 13 08:12:21 2023 +0200 sw: fix undo comment of FN_DELETE_FIELDS It's fields, not field. One has to dispatch .uno:DeleteFields to see this in action, which does something if the document already has existing reference marks. Change-Id: I81e3be3f2b68bfee2ed85a2a060dd05c3eb56670 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150300 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index ee573c4d2c93..a9e5a78828e0 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -443,6 +443,7 @@ #define STR_UPDATE_BOOKMARKS NC_("STR_UPDATE_BOOKMARKS", "Update bookmarks") #define STR_UPDATE_FIELD NC_("STR_UPDATE_FIELD", "Update field: $1") #define STR_UPDATE_FIELDS NC_("STR_UPDATE_FIELDS", "Update fields") +#define STR_DELETE_FIELDS NC_("STR_DELETE_FIELDS", "Delete fields") #define STR_SORT_TBL NC_("STR_SORT_TBL", "Sort table") #define STR_SORT_TXT NC_("STR_SORT_TXT", "Sort text") #define STR_INSTABLE_UNDO NC_("STR_INSTABLE_UNDO", "Insert table: $1$2$3") diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx index 105991347fdb..bf0fd165d3c6 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -175,6 +175,7 @@ enum class SwUndoId DELETE_BOOKMARKS, // 143 UPDATE_FIELD, // 144 UPDATE_FIELDS, // 145 + DELETE_FIELDS, // 146 }; OUString GetUndoComment(SwUndoId eId); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 27a637616608..e1fa8570f054 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -670,6 +670,9 @@ OUString GetUndoComment(SwUndoId eId) case SwUndoId::UPDATE_FIELDS: pId = STR_UPDATE_FIELDS; break; + case SwUndoId::DELETE_FIELDS: + pId = STR_DELETE_FIELDS; + break; } assert(pId); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 4f1ace85cbcb..f5f33c12e0e3 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -725,13 +725,13 @@ void DeleteFields(SfxRequest& rReq, SwWrtShell& rWrtSh) } SwDoc* pDoc = rWrtSh.GetDoc(); - pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::DELBOOKMARK, nullptr); + pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::DELETE_FIELDS, nullptr); rWrtSh.StartAction(); comphelper::ScopeGuard g( [&rWrtSh] { rWrtSh.EndAction(); - rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::DELBOOKMARK, nullptr); + rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::DELETE_FIELDS, nullptr); }); std::vector<const SwFormatRefMark*> aRemovals;