]> git.lyx.org Git - features.git/commitdiff
Unbreak citing from bibliography environment
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Dec 2018 08:43:39 +0000 (09:43 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Dec 2018 08:43:39 +0000 (09:43 +0100)
We need to bail out here early since otherwise the cache is prematurely
set to valid even if it is invalid with the bibliography environment.
The following checks (for timestamps of bib files) are only targeted
at bib(la)tex.

The fix is already in master.

src/Buffer.cpp

index 6be7d0eab3d21378be565d29f7149721e8d73f7e..35418a4537a46aeb1fa37f9ef2e6b696b3dc6bf9 100644 (file)
@@ -2472,6 +2472,18 @@ void Buffer::checkIfBibInfoCacheIsValid() const
                return;
        }
 
+       // If we already know the cache is invalid, stop here.
+       // This is important in the case when the bibliography
+       // environment (rather than Bib[la]TeX) is used.
+       // In that case, the timestamp check below gives no
+       // sensible result. Rather than that, the cache will
+       // be invalidated explicitly via invalidateBibInfoCache()
+       // by the Bibitem inset.
+       // Same applies for bib encoding changes, which trigger
+       // invalidateBibInfoCache() by InsetBibtex.
+       if (!d->bibinfo_cache_valid_)
+               return;
+
        // we'll assume it's ok and change this if it's not
        d->bibinfo_cache_valid_ = true;
        d->cite_labels_valid_ = true;