officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |    2 +-
 sw/inc/strings.hrc                                                  |    5 
++++-
 sw/qa/extras/uiwriter/uiwriter3.cxx                                 |    6 
++++--
 sw/qa/python/text_portion_enumeration_test.py                       |    2 +-
 sw/source/uibase/shells/textidx.cxx                                 |    8 
++++++++
 sw/source/uibase/uiview/viewstat.cxx                                |    7 
+++++++
 sw/uiconfig/swriter/ui/tocindexpage.ui                              |    2 +-
 7 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit e0808a1f84c40ea15d2d88beebd97659e7d46348
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Tue Sep 24 10:26:24 2024 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Sep 25 10:39:25 2024 +0200

    Resolves tdf#161574 - Individual labels for TOXes in the UI
    
    + Upper-case for Delete Index
    + User-Defined amended with Index
    
    Change-Id: I972ee22fa3681a0f1159426836a0ec1b83fa5e3f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173849
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Tested-by: Jenkins

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 1993ca6f18e0..e2d06989c0f1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -220,7 +220,7 @@
       </node>
       <node oor:name=".uno:RemoveTableOf" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Delete index</value>
+          <value xml:lang="en-US">Delete Index</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 6e7e81c383bc..5ff85970a3da 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -424,6 +424,9 @@
 #define STR_HYPERLINK                           NC_("STR_HYPERLINK", 
"Hyperlink")
 #define STR_SECTIONLINK                         NC_("STR_SECTIONLINK", 
"Section Link")
 #define STR_SECTIONCOPY                         NC_("STR_SECTIONCOPY", 
"Section Copy")
+#define STR_EDITINDEX                           NC_("STR_EDITINDEX", "Edit %1")
+#define STR_UPDATEINDEX                         NC_("STR_UPDATEINDEX", "Update 
%1")
+#define STR_DELETEINDEX                         NC_("STR_DELETEINDEX", "Delete 
%1")
 
 // Undo
 #define STR_CANT_UNDO                           NC_("STR_CANT_UNDO", "not 
possible")
@@ -753,7 +756,7 @@
 #define STR_FIELD_FIXED                         NC_("STR_FIELD_FIXED", 
"(fixed)")
 #define STR_DURATION_FORMAT                     NC_("STR_DURATION_FORMAT", " 
Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6")
 #define STR_TOI                                 NC_("STR_TOI", "Alphabetical 
Index")
-#define STR_TOU                                 NC_("STR_TOU", "User-Defined")
+#define STR_TOU                                 NC_("STR_TOU", "User-Defined 
Index")
 #define STR_TOC                                 NC_("STR_TOC", "Table of 
Contents")
 #define STR_TOX_AUTH                            NC_("STR_TOX_AUTH", 
"Bibliography")
 #define STR_TOX_CITATION                        NC_("STR_TOX_CITATION", 
"Citation")
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 870b0fb80800..e3921b316afb 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1686,7 +1686,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
         CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
         pWrtShell->Push();
         OUString const 
url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
-        
CPPUNIT_ASSERT_EQUAL(u"#1%19the%20udmark%19UUser-Defined%7Ctoxmark"_ustr, url);
+        
CPPUNIT_ASSERT_EQUAL(u"#1%19the%20udmark%19UUser-Defined%20Index%7Ctoxmark"_ustr,
+                             url); // User-Defined => User-Defined Index, 
tdf#161574
         rView.JumpToSwMark(url.subView(1));
         CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark 
the first"),
                              
pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText());
@@ -1701,7 +1702,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
         CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
         pWrtShell->Push();
         OUString const 
url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
-        
CPPUNIT_ASSERT_EQUAL(u"#2%19the%20udmark%19UUser-Defined%7Ctoxmark"_ustr, url);
+        
CPPUNIT_ASSERT_EQUAL(u"#2%19the%20udmark%19UUser-Defined%20Index%7Ctoxmark"_ustr,
+                             url); // User-Defined => User-Defined Index, 
tdf#161574
         rView.JumpToSwMark(url.subView(1));
         CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark 
the 2nd"),
                              
pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText());
diff --git a/sw/qa/python/text_portion_enumeration_test.py 
b/sw/qa/python/text_portion_enumeration_test.py
index c9d859d0267b..9684e03f9a01 100644
--- a/sw/qa/python/text_portion_enumeration_test.py
+++ b/sw/qa/python/text_portion_enumeration_test.py
@@ -3446,7 +3446,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
         xIndex5 = xIndexes["User-Defined1"]
         self.assertTrue(self.eq(xIndex5.MetadataReference,
                         StringPair("content.xml", "idUD")), "idUD")
-        xIndex5s = xSections["User-Defined1"]
+        xIndex5s = xSections["User-Defined Index1"] # User-Defined => 
User-Defined Index, tdf#161574
         self.assertTrue(self.eq(xIndex5s.MetadataReference,
                         StringPair("content.xml", "idUD")), "idUD")
         xIndex6 = xIndexes["Table of Objects1"]
diff --git a/sw/source/uibase/shells/textidx.cxx 
b/sw/source/uibase/shells/textidx.cxx
index 35642a73f198..c8eb43dba577 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -34,6 +34,8 @@
 #include <idxmrk.hxx>
 #include <toxmgr.hxx>
 #include <swabstdlg.hxx>
+#include <strings.hrc>
+#include <svl/whiter.hxx>
 
 #include <ndtxt.hxx>
 #include <fmtfld.hxx>
@@ -270,6 +272,12 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
         else
             rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, true));
 
+        SfxWhichIter aIter(rSet);
+        if (aIter.FirstWhich() == FN_REMOVE_CUR_TOX)
+        {
+            const OUString sLabel = SwResId(STR_DELETEINDEX).replaceAll("%1", 
pBase->GetTypeName());
+            rSet.Put(SfxStringItem(FN_REMOVE_CUR_TOX, sLabel));
+        }
     }
     else if ( rSh.CursorInsideInputField() )
     {
diff --git a/sw/source/uibase/uiview/viewstat.cxx 
b/sw/source/uibase/uiview/viewstat.cxx
index 06fe55464b49..45267fc42651 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -288,6 +288,13 @@ void SwView::GetState(SfxItemSet &rSet)
                 if(nullptr == (pBase = m_pWrtShell->GetCurTOX()) ||
                     (FN_EDIT_CURRENT_TOX == nWhich && 
pBase->IsTOXBaseInReadonly()))
                     rSet.DisableItem(nWhich);
+                else
+                {
+                    const OUString sLabel
+                        = SwResId(nWhich == FN_EDIT_CURRENT_TOX ? 
STR_EDITINDEX : STR_UPDATEINDEX)
+                              .replaceAll("%1", pBase->GetTypeName());
+                    rSet.Put(SfxStringItem(nWhich, sLabel));
+                }
             }
             break;
             case SID_TWAIN_SELECT:
diff --git a/sw/uiconfig/swriter/ui/tocindexpage.ui 
b/sw/uiconfig/swriter/ui/tocindexpage.ui
index d43f291fe208..7b0f30a5ffbb 100644
--- a/sw/uiconfig/swriter/ui/tocindexpage.ui
+++ b/sw/uiconfig/swriter/ui/tocindexpage.ui
@@ -142,7 +142,7 @@
                       <item id="2" translatable="yes" 
context="tocindexpage|liststore1">Alphabetical Index</item>
                       <item id="4" translatable="yes" 
context="tocindexpage|liststore1">Table of Figures</item>
                       <item id="8" translatable="yes" 
context="tocindexpage|liststore1">Index of Tables</item>
-                      <item id="16" translatable="yes" 
context="tocindexpage|liststore1">User-Defined</item>
+                      <item id="16" translatable="yes" 
context="tocindexpage|liststore1">User-Defined Index</item>
                       <item id="32" translatable="yes" 
context="tocindexpage|liststore1">Table of Objects</item>
                       <item id="64" translatable="yes" 
context="tocindexpage|liststore1">Bibliography</item>
                     </items>

Reply via email to