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 55f6141b65411f15a99d509ad5bd7bbab63cd129
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed May 3 20:02:36 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu May 4 08:14:46 2023 +0200

    sw: fix undo comment of FN_UPDATE_SECTIONS
    
    It's an update of sections, not insert of a section. One has to dispatch
    .uno:UpdateSections to see this in action, which does something if the
    document already has existing sections.
    
    Change-Id: Iaca5448feceea3fc2bc450586e5f67981550d8f3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151339
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index a29a9c9e6e52..cfdd1f00fd64 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -444,6 +444,7 @@
 #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_UPDATE_SECTIONS                     NC_("STR_UPDATE_SECTIONS", 
"Update 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 bf0fd165d3c6..5f0e006114f8 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -176,6 +176,7 @@ enum class SwUndoId
     UPDATE_FIELD,                      // 144
     UPDATE_FIELDS,                     // 145
     DELETE_FIELDS,                     // 146
+    UPDATE_SECTIONS,                   // 147
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 523d065989f4..6b6785d79c1e 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -673,6 +673,9 @@ OUString GetUndoComment(SwUndoId eId)
         case SwUndoId::DELETE_FIELDS:
             pId = STR_DELETE_FIELDS;
             break;
+        case SwUndoId::UPDATE_SECTIONS:
+            pId = STR_UPDATE_SECTIONS;
+            break;
     }
 
     assert(pId);
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index b66772a6dbca..4f2a3629101f 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -401,7 +401,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
         pSections->GetValue() >>= aSections;
     }
 
-    rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSSECTION, 
nullptr);
+    
rWrtSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_SECTIONS, 
nullptr);
     rWrtSh.StartAction();
 
     SwDoc* pDoc = rWrtSh.GetDoc();
@@ -449,7 +449,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
     }
 
     rWrtSh.EndAction();
-    rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSSECTION, 
nullptr);
+    rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_SECTIONS, 
nullptr);
 }
 
 void DeleteSections(SfxRequest& rReq, SwWrtShell& rWrtSh)

Reply via email to