[LyX/master] Fix length of index entries in outliner (#13289)
Juergen Spitzmueller <[email protected]>
| Newsgroups | gmane.editors.lyx.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 225b5beb47b46835de1273936fed62c06bd6f53d Author: Juergen Spitzmueller <[email protected]> Date: Fri Mar 27 08:46:51 2026 +0100 Fix length of index entries in outliner (#13289) --- src/insets/InsetCollapsible.cpp | 4 ++-- src/insets/InsetCollapsible.h | 2 +- src/insets/InsetIndex.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index fe8c7b2142..14ea0a9825 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -487,10 +487,10 @@ bool InsetCollapsible::clickable(BufferView const & bv, int x, int y) const } -docstring const InsetCollapsible::getNewLabel(docstring const & l) const +docstring const InsetCollapsible::getNewLabel(docstring const & l, + pos_type const max_length) const { odocstringstream label; - pos_type const max_length = 15; pos_type const p_siz = paragraphs().begin()->size(); pos_type const n = min(max_length, p_siz); pos_type i = 0; diff --git a/src/insets/InsetCollapsible.h b/src/insets/InsetCollapsible.h index 5dfd1bc627..a485f81b94 100644 --- a/src/insets/InsetCollapsible.h +++ b/src/insets/InsetCollapsible.h @@ -72,7 +72,7 @@ public: void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const override; /// - docstring const getNewLabel(docstring const & l) const; + docstring const getNewLabel(docstring const & l, pos_type const max_length = 15) const; /// bool editable() const override; /// diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 36e4b67d63..09d8790f24 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -1137,7 +1137,7 @@ void InsetIndex::addToToc(DocIterator const & cpit, bool output_active, if (!il.contentaslabel()) str = label; else { - str = getNewLabel(label); + str = getNewLabel(label, TOC_ENTRY_LENGTH); OutputParams const rp(0); vector<docstring> sublbls = getSubentriesAsText(rp, true); for (auto const & sublbl : sublbls) { -- lyx-cvs mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-cvs