]> git.lyx.org Git - lyx.git/commitdiff
Rename subindex to subentry
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Oct 2022 05:51:38 +0000 (06:51 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Oct 2022 05:51:38 +0000 (06:51 +0100)
Makes more sense, and distinguishes it better from printsubindex

15 files changed:
autotests/export/docbook/index.lyx
autotests/export/docbook/index_light.lyx
autotests/export/docbook/index_multiple.lyx
autotests/export/docbook/index_nesting.lyx
development/FORMAT
lib/layouts/stdinsets.inc
lib/lyx2lyx/lyx_2_4.py
lib/ui/stdcontext.inc
lib/ui/stdmenus.inc
src/LyXAction.cpp
src/factory.cpp
src/insets/InsetIndex.cpp
src/insets/InsetIndexMacro.cpp
src/insets/InsetIndexMacro.h
src/tex2lyx/text.cpp

index 18398c7e2b6ea6f84628ddac6e735d3f4810b6ff..4a0eb07b04f1253765983d4db2583a564f5df1f5 100644 (file)
@@ -195,7 +195,7 @@ status open
 
 \begin_layout Plain Layout
 Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -226,7 +226,7 @@ SortedPrimary
 \end_inset
 
 Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -248,7 +248,7 @@ status open
 
 \begin_layout Plain Layout
 Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -258,7 +258,7 @@ Secondary
 \end_inset
 
 
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
index ce4dd7ec8ac2d0ec8f27eba8451628e6c84f6fa0..368af82193f6cfebbc5d1db2f707d8ecdf4f21e3 100644 (file)
@@ -110,7 +110,7 @@ status open
 
 \begin_layout Plain Layout
 Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -132,7 +132,7 @@ status open
 
 \begin_layout Plain Layout
 Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -142,7 +142,7 @@ Secondary
 \end_inset
 
 
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
index 66542aaf154b98b652bbd714d05437c5229096b6..5e4fcddd38a5b8cde98c27650db815f807450db8 100644 (file)
@@ -118,7 +118,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -143,7 +143,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -153,7 +153,7 @@ B
 \end_inset
 
 
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -178,7 +178,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -203,7 +203,7 @@ status open
 
 \begin_layout Plain Layout
 E
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
index 545244aa4d164ab4144863d636c121a5b14f4648..dd352cd0c6c260c41d2d8a635e1033b68b82a9cf 100644 (file)
@@ -112,7 +112,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -137,7 +137,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -147,7 +147,7 @@ B
 \end_inset
 
 
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -172,7 +172,7 @@ status open
 
 \begin_layout Plain Layout
 A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
@@ -197,7 +197,7 @@ status open
 
 \begin_layout Plain Layout
 E
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
 status open
 
 \begin_layout Plain Layout
index 430f3a20f3d35342870f33cefa0102de5b60fb75..0c41d8801cac835667807d1da7a2c66946528e06 100644 (file)
@@ -9,10 +9,10 @@ changes happened in particular if possible. A good example would be
 
 2022-10-29 Jürgen Spitzmüller <spitz@lyx.org> 
        * Format incremented to 610: InsetIndexMacros and new IndexInset params:
-         - \begin_inset IndexMacro [see|seealso|subindex|sortkey], relating to
+         - \begin_inset IndexMacro [see|seealso|subentry|sortkey], relating to
            \index{...|see{content}} -- see
            \index{...|seealso{content}} -- seealso
-           \index{...!subindex} -- subindex
+           \index{...!subentry} -- subentry
            \index{sortkey@...} -- sortkey
            see and see also are mutually exclusive
          - \begin_inset Index
index 4063c630d702732ba225c715253ab7ec7d01db99..614aa1df9b3fedddccc6e949dd39f9c3fd91b7f1 100644 (file)
@@ -456,9 +456,9 @@ InsetLayout IndexMacro:sortkey
        LabelString           "Sort as"
 End
 
-InsetLayout IndexMacro:subindex
+InsetLayout IndexMacro:subentry
        CopyStyle             IndexMacro:see
-       LabelString           "Subindex"
+       LabelString           "Subentry"
 End
 
 InsetLayout Box
index 62aeb7607e0a963153d48bd65ca6c797921b7621..e4fe3f97ac3de24f823e2f1773d1b5e31e746f2c 100644 (file)
@@ -4461,15 +4461,15 @@ def revert_index_macros(document):
         if j == -1:
             document.warning("Malformed LyX document: Can't find end of index inset at line %d" % i)
             continue
-        # We search for all possible subindexes in turn, store their
+        # We search for all possible subentries in turn, store their
         # content and delete them
         see = []
         seealso = []
-        subindex = []
-        subindex2 = []
+        subentry = []
+        subentry2 = []
         sortkey = []
-        # Two subindexes are allowed, thus the duplication
-        imacros = ["seealso", "see", "subindex", "subindex", "sortkey"]
+        # Two subentries are allowed, thus the duplication
+        imacros = ["seealso", "see", "subentry", "subentry", "sortkey"]
         for imacro in imacros:
             iim = find_token(document.body, "\\begin_inset IndexMacro %s" % imacro, i, j)
             if iim == -1:
@@ -4491,8 +4491,8 @@ def revert_index_macros(document):
                 seealso = icont[1:]
             elif imacro == "see":
                 see = icont[1:]
-            elif imacro == "subindex":
-                # subindexes might hace their own sortkey!
+            elif imacro == "subentry":
+                # subentries might hace their own sortkey!
                 xiim = find_token(document.body, "\\begin_inset IndexMacro sortkey", iimpl, iimple)
                 if xiim != -1:
                     xiime = find_end_of_inset(document.body, xiim)
@@ -4510,10 +4510,10 @@ def revert_index_macros(document):
                                 xicont = document.body[xiimpl:xiimple]
                                 xxicont = document.body[iimpl:xiimpl] + document.body[xiimple+1:iimple]
                                 icont = xicont + put_cmd_in_ert("@") + xxicont[1:]
-                if len(subindex) > 0:
-                    subindex2 = icont[1:]
+                if len(subentry) > 0:
+                    subentry2 = icont[1:]
                 else:
-                    subindex = icont[1:]
+                    subentry = icont[1:]
             elif imacro == "sortkey":
                 sortkey = icont
             # Everything stored. Delete subinset.
@@ -4538,10 +4538,10 @@ def revert_index_macros(document):
             document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + "seealso{") + seealso + put_cmd_in_ert("}")
         elif pageformat != "default":
             document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + pageformat)
-        if len(subindex2) > 0:
-            document.body[ple:ple] = put_cmd_in_ert("!") + subindex2
-        if len(subindex) > 0:
-            document.body[ple:ple] = put_cmd_in_ert("!") + subindex
+        if len(subentry2) > 0:
+            document.body[ple:ple] = put_cmd_in_ert("!") + subentry2
+        if len(subentry) > 0:
+            document.body[ple:ple] = put_cmd_in_ert("!") + subentry
         if len(sortkey) > 0:
             document.body[pl:pl+1] = document.body[pl:pl] + sortkey + put_cmd_in_ert("@")
             
index b230cdd3f02fffcc1fa5cc3536e63b4c76ce80fb..d073006eb751ef5da968d00851072da5a83063a7 100644 (file)
@@ -633,7 +633,7 @@ Menuset
        End
        
        Menu "context-edit-index"
-               OptItem "Insert Subentry|b" "indexmacro-insert subindex"
+               OptItem "Insert Subentry|b" "indexmacro-insert subentry"
                OptItem "Insert Sortkey|k" "indexmacro-insert sortkey"
                OptItem "Insert See Reference|e" "indexmacro-insert see"
                OptItem "Insert See also Reference|a" "indexmacro-insert seealso"
index 46287be10003e1d62af8e252fc784d9fa620c26c..301cdac8d7b69cdac8edf64dc0628d685dda4478 100644 (file)
@@ -534,7 +534,7 @@ Menuset
        End
 
        Menu "index_properties"
-               OptItem "Subentry|b" "indexmacro-insert subindex"
+               OptItem "Subentry|b" "indexmacro-insert subentry"
                OptItem "Sortkey|k" "indexmacro-insert sortkey"
                OptItem "See|e" "indexmacro-insert see"
                OptItem "See also|a" "indexmacro-insert seealso"
index 0e9a79c1197f111d07457027214560b90c7d689a..742c6132063cf9b670248048726416136d0efcd0 100644 (file)
@@ -2311,7 +2311,7 @@ void LyXAction::init()
  * \var lyx::FuncCode lyx::LFUN_INDEXMACRO_INSERT
  * \li Action: Inserts special Index macros into the document.
  * \li Syntax: indexmacro-insert <type>
- * \li Params: <type>: see, seealso, subindex, sortkey.
+ * \li Params: <type>: see, seealso, subentry, sortkey.
  * \li Origin: spitz, 20 Feb 2022
  * \endvar
  */
index 4ab74dad4c59093c54c8b3146989e758151a2355..a465a55e86db268b622a9874f81a4bd3d011c943 100644 (file)
@@ -163,8 +163,8 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                case LFUN_INDEXMACRO_INSERT: {
                        string const arg = cmd.getArg(0);
                        if (arg != "see" && arg != "seealso"
-                           && arg != "subindex" && arg != "sortkey") {
-                               LYXERR0("LFUN_IPAMACRO_INSERT: wrong argument");
+                           && arg != "subentry" && arg != "sortkey") {
+                               LYXERR0("LFUN_INDEXMACRO_INSERT: wrong argument");
                                return nullptr;
                        }
                        return new InsetIndexMacro(buf, arg);
index 5f4cb7e93fc49ab81d4738118603d9dfb15d46cb..2234d9da15dae24747398dd2d8dd5755b2efb1d8 100644 (file)
@@ -582,8 +582,8 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_PARAGRAPH_BREAK: {
                // Since this inset in single-par anyway, let's use
-               // return to enter subindexes
-               FuncRequest fr(LFUN_INDEXMACRO_INSERT, "subindex");
+               // return to enter subentryes
+               FuncRequest fr(LFUN_INDEXMACRO_INSERT, "subentry");
                lyx::dispatch(fr);
                break;
        }
@@ -620,7 +620,7 @@ bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
        }
        
        case LFUN_PARAGRAPH_BREAK:
-               return macrosPossible("subindex");
+               return macrosPossible("subentry");
        
        case LFUN_INDEXMACRO_INSERT:
                return macrosPossible(cmd.getArg(0));
@@ -675,7 +675,7 @@ void InsetIndex::getSubentries(otexstream & os, OutputParams const & runparams)
                if (inset.lyxCode() == INDEXMACRO_CODE) {
                        InsetIndexMacro const & iim =
                                static_cast<InsetIndexMacro const &>(inset);
-                       if (iim.params().type == InsetIndexMacroParams::Subindex) {
+                       if (iim.params().type == InsetIndexMacroParams::Subentry) {
                                ++i;
                                if (i > 2)
                                        return;
@@ -700,7 +700,7 @@ std::vector<docstring> InsetIndex::getSubentriesAsText(OutputParams const & runp
                if (inset.lyxCode() == INDEXMACRO_CODE) {
                        InsetIndexMacro const & iim =
                                static_cast<InsetIndexMacro const &>(inset);
-                       if (iim.params().type == InsetIndexMacroParams::Subindex) {
+                       if (iim.params().type == InsetIndexMacroParams::Subentry) {
                                ++i;
                                if (i > 2)
                                        break;
@@ -819,7 +819,7 @@ bool hasInsetWithCode(const InsetIndex * const inset_index, const InsetCode code
 
 bool InsetIndex::hasSubentries() const
 {
-       return hasInsetWithCode(this, INDEXMACRO_CODE, {InsetIndexMacroParams::Subindex});
+       return hasInsetWithCode(this, INDEXMACRO_CODE, {InsetIndexMacroParams::Subentry});
 }
 
 
@@ -838,7 +838,7 @@ bool InsetIndex::hasSortKey() const
 bool InsetIndex::macrosPossible(string const type) const
 {
        if (type != "see" && type != "seealso"
-           && type != "sortkey" && type != "subindex")
+           && type != "sortkey" && type != "subentry")
                return false;
 
        Paragraph const & par = paragraphs().front();
@@ -854,8 +854,8 @@ bool InsetIndex::macrosPossible(string const type) const
                             && (iim.params().type == InsetIndexMacroParams::See
                                 || iim.params().type == InsetIndexMacroParams::Seealso))
                                return false;
-                       if (type == "subindex"
-                            && iim.params().type == InsetIndexMacroParams::Subindex) {
+                       if (type == "subentry"
+                            && iim.params().type == InsetIndexMacroParams::Subentry) {
                                ++subidxs;
                                if (subidxs > 1)
                                        return false;
index 2bfbc9176aac065e7190c850180186f5b0a9c6b2..31754308f8565a20046edc1d3c84976030c489e9 100644 (file)
@@ -52,7 +52,7 @@ InsetIndexMacroTranslator const init_insetindexmacrotranslator()
 {
        InsetIndexMacroTranslator translator("see", InsetIndexMacroParams::See);
        translator.addPair("seealso", InsetIndexMacroParams::Seealso);
-       translator.addPair("subindex", InsetIndexMacroParams::Subindex);
+       translator.addPair("subentry", InsetIndexMacroParams::Subentry);
        translator.addPair("sortkey", InsetIndexMacroParams::Sortkey);
        return translator;
 }
@@ -62,7 +62,7 @@ InsetIndexMacroTranslatorLoc const init_insetindexmacrotranslator_loc()
 {
        InsetIndexMacroTranslatorLoc translator(_("See"), InsetIndexMacroParams::See);
        translator.addPair(_("See also"), InsetIndexMacroParams::Seealso);
-       translator.addPair(_("Subindex"), InsetIndexMacroParams::Subindex);
+       translator.addPair(_("Subentry"), InsetIndexMacroParams::Subentry);
        translator.addPair(_("Sort as"), InsetIndexMacroParams::Sortkey);
        return translator;
 }
@@ -155,7 +155,7 @@ void InsetIndexMacro::read(Lexer & lex)
 
 void InsetIndexMacro::getLatex(otexstream & os, OutputParams const & runparams) const
 {
-       if (params_.type == InsetIndexMacroParams::Subindex) {
+       if (params_.type == InsetIndexMacroParams::Subentry) {
                if (hasSortKey()) {
                        getSortkey(os, runparams);
                        os << "@";
@@ -374,7 +374,7 @@ bool InsetIndexMacro::insetAllowed(InsetCode code) const
        case INDEX_CODE:
                return false;
        case INDEXMACRO_SORTKEY_CODE:
-               return (params_.type == InsetIndexMacroParams::Subindex
+               return (params_.type == InsetIndexMacroParams::Subentry
                        && !hasSortKey());
        default:
                return InsetCollapsible::insetAllowed(code);
index 4122621ea0338121e720dc2faf0beb8285e8b7cc..3d56e399de7191fa9345526e41cf7faceeaea1a0 100644 (file)
@@ -27,7 +27,7 @@ public:
        enum Type {
                See,
                Seealso,
-               Subindex,
+               Subentry,
                Sortkey
        };
        ///
index b661e6fc85cbefc8c2716c08a8005eccb453c33e..e11d0a5becbe9e7f9675dcf6eb68dffd080ea01c 100644 (file)
@@ -1563,7 +1563,7 @@ void parse_index_entry(Parser & p, ostream & os, Context & context, string const
                                p.get_token();
                                os << "\\begin_layout Plain Layout\n";
                        } else {
-                               begin_inset(os, "IndexMacro subindex");
+                               begin_inset(os, "IndexMacro subentry");
                                os << "\nstatus collapsed\n";
                        }
                        // Check for (level-specific) sortkey
@@ -1583,7 +1583,7 @@ void parse_index_entry(Parser & p, ostream & os, Context & context, string const
                        main = false;
                }
                if (!main) {
-                       begin_inset(os, "IndexMacro subindex");
+                       begin_inset(os, "IndexMacro subentry");
                        os << "\nstatus collapsed\n";
                }
                // Final level
@@ -1626,7 +1626,7 @@ void parse_index_entry(Parser & p, ostream & os, Context & context, string const
                        os << "\n\\end_layout\n";
                } else {
                        if (post.empty() && !startrange && !endrange) {
-                               parse_text_in_inset(p, os, FLAG_BRACE_LAST, false, context, "IndexMacro subindex");
+                               parse_text_in_inset(p, os, FLAG_BRACE_LAST, false, context, "IndexMacro subentry");
                                p.dropPosition();
                        } else {
                                // Handle post-argument