commit 263f36e2ddb2edb0b3da216e24cd83da2ed22fc0
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Mar 27 08:46:51 2026 +0100
Fix length of index entries in outliner (#13289)
(cherry picked from commit 225b5beb47b46835de1273936fed62c06bd6f53d)
---
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 695e05472f..c1adf5bc78 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 1a4e8cdb91..0ee74341b5 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -1143,7 +1143,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