]> git.lyx.org Git - features.git/commitdiff
Some minor amendments to [3ae6bff538/lyxgit]
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 29 Dec 2018 09:26:28 +0000 (10:26 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 29 Dec 2018 09:26:28 +0000 (10:26 +0100)
src/Buffer.cpp
src/Buffer.h

index fc27823c1f0efc163239aa429dc5a158aea519cc..385c0d024eaf7f58f6e63359d38dda1c21c4b286 100644 (file)
@@ -318,7 +318,7 @@ public:
        /// was missing).
        bool preview_error_;
 
-       /// Cache the insets, their associated refs (with positions),
+       /// Cache the label insets, their associated refs (with positions),
        /// and whether the insets are active.
        mutable RefCache ref_cache_;
 
@@ -3900,7 +3900,7 @@ Buffer::References & Buffer::getReferenceCache(docstring const & label)
        // In what follows, we look whether we find an active label
        // with the given string in the cache. If so, return its
        // references cache. If we only find an inactive one, return
-       // that (the last we find, coincidentally). If we find noting,
+       // that (the last we find, coincidentally). If we find nothing,
        // return an empty references cache.
        static LabelInfo linfo;
        linfo.inset = nullptr;
@@ -3965,14 +3965,10 @@ InsetLabel const * Buffer::insetLabel(docstring const & label,
 
 bool Buffer::activeLabel(docstring const & label) const
 {
-       if (!insetLabel(label))
+       if (!insetLabel(label, true))
                return false;
 
-       for (auto & rc : masterBuffer()->d->ref_cache_) {
-               if (rc.label == label && rc.active)
-                       return true;
-       }
-       return false;
+       return true;
 }
 
 
index a6cbd572d364d907e44e5be4ce5f998a4df60df5..99cfce1fe12eb160331cac29c9fb74336498e939 100644 (file)
@@ -713,7 +713,8 @@ public:
        void setInsetLabel(docstring const & label, InsetLabel const * il,
                           bool const active);
        /// \return the InsetLabel associated with this \p label string
-       /// If \p active is true we only return active labels.
+       /// If \p active is true we only return active labels
+       /// (see @ref activeLabel)
        InsetLabel const * insetLabel(docstring const & label,
                                      bool const active = false) const;
        /// \return true if this \param label is an active label.