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 db73d73c4031c20cede546e00b2fc34d673f3069 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Mar 8 20:13:41 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Mar 9 07:00:12 2023 +0000 sw: fix undo comment of FN_UPDATE_BOOKMARKS It's updates, not insert. One has to dispatch .uno:UpdateBookmarks to see this in action, which does something if the document already contains at least one bookmark. Change-Id: I32d259b0b5c18cbbec2969cd189ca7ba4dd0dde4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148487 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 033a1a225a92..2965e6b884b2 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -439,6 +439,7 @@ #define STR_DELBOOKMARK NC_("STR_DELBOOKMARK", "Delete bookmark: $1") #define STR_INSBOOKMARK NC_("STR_INSBOOKMARK", "Insert bookmark: $1") #define STR_UPDATE_BOOKMARK NC_("STR_UPDATE_BOOKMARK", "Update bookmark: $1") +#define STR_UPDATE_BOOKMARKS NC_("STR_UPDATE_BOOKMARKS", "Update bookmarks") #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 d4da619560cc..efca97bc1b23 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -171,6 +171,7 @@ enum class SwUndoId UPDATE_FORM_FIELDS, // 139 DELETE_FORM_FIELDS, // 140 UPDATE_BOOKMARK, // 141 + UPDATE_BOOKMARKS, // 142 }; OUString GetUndoComment(SwUndoId eId); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index d872bc812166..8e5638205c61 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -658,6 +658,9 @@ OUString GetUndoComment(SwUndoId eId) case SwUndoId::UPDATE_BOOKMARK: pId = STR_UPDATE_BOOKMARK; break; + case SwUndoId::UPDATE_BOOKMARKS: + pId = STR_UPDATE_BOOKMARKS; + break; } assert(pId); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index f1d9522a89f7..b52e26778388 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -515,7 +515,7 @@ void UpdateBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh) pBookmarks->GetValue() >>= aBookmarks; } - rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSBOOKMARK, nullptr); + rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_BOOKMARKS, nullptr); rWrtSh.StartAction(); IDocumentMarkAccess& rIDMA = *rWrtSh.GetDoc()->getIDocumentMarkAccess(); @@ -578,7 +578,7 @@ void UpdateBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh) } rWrtSh.EndAction(); - rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSBOOKMARK, nullptr); + rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_BOOKMARKS, nullptr); } void UpdateBookmark(SfxRequest& rReq, SwWrtShell& rWrtSh)