commit 51a10eee02fbc0b262a0043b6576bd5d16849d1d
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Mar 27 10:09:25 2026 +0100
Amend 225b5beb47b
The previous solution did not work well with subentries
(cherry picked from commit bab48a45852082780fd0e34f932c65bb45cdf8e7)
---
src/insets/InsetIndex.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index 0ee74341b5..b62e79a564 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -1143,20 +1143,20 @@ void InsetIndex::addToToc(DocIterator const & cpit,
bool output_active,
if (!il.contentaslabel())
str = label;
else {
- str = getNewLabel(label, TOC_ENTRY_LENGTH);
OutputParams const rp(0);
vector<docstring> sublbls = getSubentriesAsText(rp, true);
+ docstring sublabel;
for (auto const & sublbl : sublbls) {
- str += " " + docstring(1, char_type(0x2023));//
TRIANGULAR BULLET
- str += " " + sublbl;
+ sublabel += " " + docstring(1, char_type(0x2023));//
TRIANGULAR BULLET
+ sublabel += " " + sublbl;
}
docstring see = getSeeAsText(rp, true);
if (see.empty() && !getSeeAlsoesAsText(rp, true).empty())
see = getSeeAlsoesAsText(rp, true).front();
- if (!see.empty()) {
- str += " " + docstring(1, char_type(0x261e));// WHITE
RIGHT POINTING INDEX
- str += " " + see;
- }
+ if (!see.empty())
+ see = " " + docstring(1, char_type(0x261e)) + see;//
WHITE RIGHT POINTING INDEX
+ int const maxlen = TOC_ENTRY_LENGTH - sublabel.size() -
see.size();
+ str = getNewLabel(label, maxlen) + sublabel + see;
}
string type = "index";
if (buffer().masterBuffer()->params().use_indices)
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs