]> git.lyx.org Git - lyx.git/commitdiff
Use the old-style sorts of label strings in the TOC.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 5 Aug 2024 22:11:24 +0000 (18:11 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 5 Aug 2024 22:23:25 +0000 (18:23 -0400)
There are several reasons to do it this way, among which is odd
behavior of the TOC filter if we put anything else there. This also
allows for filtering of the references themsevles in a natural way.

The change, I think, was really an unintended consequence of other
changes connected to showing formatted references in the work area.

(cherry picked from commit 1de4645286e5e51d2e5f6084ee53f3fcb463475d)

src/insets/InsetRef.cpp
src/insets/InsetRef.h
status.24x

index 6021a239d26cc836f4af2695290a332c69a91ef1..4565128e0ceeaae0259618f6b6a8b7b8b0cbd757 100644 (file)
@@ -539,11 +539,14 @@ 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;
-       // If use_formatted_ref is active, this will be overwritten in addToToc.
-       // (We can't do it now because it might be a forward-reference
-       // and so the reference might not be in the label cache yet.
+       // This also can be overwritten in addToToc. (We can't do it now
+       // because it might be a forward-reference and so the reference might
+       // not be in the label cache yet.)
        broken_ = false;
        setBroken(broken_);
 }
@@ -661,7 +664,7 @@ docstring InsetRef::getTOCString() const
                broken_ = !buffer().activeLabel(label) && active_;
        else 
                broken_ = active_;
-       return tooltip_.empty() ? screenLabel() : tooltip_;
+       return (broken_ ? _("BROKEN: ") : docstring()) + toc_string_;
 }
 
 } // namespace lyx
index 97e64a69e2b05195c8b1600344dac1284b04004b..52c8de79e23d43e9e130c78661befff349866470 100644 (file)
@@ -127,6 +127,8 @@ private:
        ///
        mutable docstring screen_label_;
        ///
+       mutable docstring toc_string_;
+       ///
        mutable bool broken_;
        ///
        mutable bool active_;
index 9cf76feed5229e4c5ef9dfac02b85702ac256f3f..57557afbee6d6b516b6f26406044dcd94139dfeb 100644 (file)
@@ -83,6 +83,9 @@ What's new
 
 - Fix ghost image on Windows with system colors (bug 13084).
 
+- Restore old display of cross-references in the outliner. The change led to
+  odd behavior on filtering.
+
 
 * INTERNALS