summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-05-17 20:14:57 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-05-18 08:22:10 +0200
commitf5b3f8d6d9d7c060e35b6da295c043576cd36a57 (patch)
treedf9c4b43d8b8ed28f4b584b14f14597f03d8ab53
parent1c98c88a1208f47327ac2f3beaf593521ce9b394 (diff)
sw: fix undo comment of FN_DELETE_SECTIONS
It's sections, not section. One has to dispatch .uno:DeleteSections to see this in action, which does something if the document already has existing sections. I think this was the last place where the relatively new biblio-related UNO commands had a wrong undo comment. Change-Id: I55074174a498f26ea7bda721988940a86ad2e458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151930 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/inc/strings.hrc1
-rw-r--r--sw/inc/swundo.hxx1
-rw-r--r--sw/source/core/undo/undobj.cxx3
-rw-r--r--sw/source/uibase/shells/textsh1.cxx4
4 files changed, 7 insertions, 2 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index e9f4927c6200..b7c8137c8275 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -445,6 +445,7 @@
#define STR_UPDATE_FIELDS NC_("STR_UPDATE_FIELDS", "Update fields")
#define STR_DELETE_FIELDS NC_("STR_DELETE_FIELDS", "Delete fields")
#define STR_UPDATE_SECTIONS NC_("STR_UPDATE_SECTIONS", "Update sections")
+#define STR_DELETE_SECTIONS NC_("STR_DELETE_SECTIONS", "Delete sections")
#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 b8bf714aa580..a0a7d918d017 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -178,6 +178,7 @@ enum class SwUndoId
DELETE_FIELDS, // 146
UPDATE_SECTIONS, // 147
CHANGE_THEME = 148,
+ DELETE_SECTIONS = 149,
};
OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index e5d8469feb3c..712b8252e79d 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -679,6 +679,9 @@ OUString GetUndoComment(SwUndoId eId)
case SwUndoId::CHANGE_THEME:
pId = STR_UNDO_CHANGE_THEME_COLORS;
break;
+ case SwUndoId::DELETE_SECTIONS:
+ pId = STR_DELETE_SECTIONS;
+ break;
}
assert(pId);
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index a03c8b7249ef..774f6299559a 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -480,13 +480,13 @@ void DeleteSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
aSectionNamePrefix = pSectionNamePrefix->GetValue();
}
- rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::DELSECTION, nullptr);
+ rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::DELETE_SECTIONS, nullptr);
rWrtSh.StartAction();
comphelper::ScopeGuard g(
[&rWrtSh]
{
rWrtSh.EndAction();
- rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::DELSECTION, nullptr);
+ rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::DELETE_SECTIONS, nullptr);
});
SwDoc* pDoc = rWrtSh.GetDoc();