diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/strings.hrc | 1 | ||||
-rw-r--r-- | sw/inc/swundo.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 8 |
4 files changed, 10 insertions, 3 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 40cbb9acb8c4..8b8b1df2731c 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -438,6 +438,7 @@ #define STR_INSERT_GLOSSARY NC_("STR_INSERT_GLOSSARY", "Insert AutoText") #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_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 61261fb9769b..d4da619560cc 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -170,6 +170,7 @@ enum class SwUndoId UPDATE_FORM_FIELD, // 138 UPDATE_FORM_FIELDS, // 139 DELETE_FORM_FIELDS, // 140 + UPDATE_BOOKMARK, // 141 }; OUString GetUndoComment(SwUndoId eId); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 3c5f3844591e..d872bc812166 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -655,6 +655,9 @@ OUString GetUndoComment(SwUndoId eId) case SwUndoId::DELETE_FORM_FIELDS: pId = STR_UNDO_DELETE_FORM_FIELDS; break; + case SwUndoId::UPDATE_BOOKMARK: + pId = STR_UPDATE_BOOKMARK; + break; } assert(pId); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index b68d5cd83baa..156572854c19 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -610,13 +610,15 @@ void UpdateBookmark(SfxRequest& rReq, SwWrtShell& rWrtSh) return; } - rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSBOOKMARK, nullptr); + SwRewriter aRewriter; + aRewriter.AddRule(UndoArg1, pBookmark->GetName()); + rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_BOOKMARK, &aRewriter); rWrtSh.StartAction(); comphelper::ScopeGuard g( - [&rWrtSh] + [&rWrtSh, &aRewriter] { rWrtSh.EndAction(); - rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSBOOKMARK, nullptr); + rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_BOOKMARK, &aRewriter); }); |