[LyX/2.4.x] set toc_string_ before the label is being truncated

Richard Kimberly Heck rikiheck at lyx.org
Tue Aug 6 15:08:08 UTC 2024


commit f37bd183abf165de325964387c94c9948c0ac9ec
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Aug 6 10:57:11 2024 +0200

    set toc_string_ before the label is being truncated
    
    We do not want truncated items in the outliner.
    
    (cherry picked from commit 8aeee03e3ad61b437fb8ef9a4b5c4744f5b18c22)
---
 src/insets/InsetRef.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index 4565128e0c..a75de56d5b 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -530,6 +530,7 @@ void InsetRef::updateBuffer(ParIterator const & it, UpdateType, bool const /*del
 
 	bool const use_formatted_ref = buffer().params().use_formatted_ref;
 	unsigned int const maxLabelChars = 24;
+	toc_string_ = label;
 	// Show label in tooltip when formatted references are shown in the work
 	// area or it is too long
 	if (use_formatted_ref || label.size() > maxLabelChars) {
@@ -539,8 +540,7 @@ void InsetRef::updateBuffer(ParIterator const & it, UpdateType, bool const /*del
 		// put cross-reference value into tooltip
 		tooltip_ = displayString(ref, cmd);
 	}
-	toc_string_ = label;
-	
+
 	// Note: This could be changed later, in addToToc, if we are using
 	// fomatted references in the work area.
 	screen_label_ = label;


More information about the lyx-cvs mailing list