]> git.lyx.org Git - features.git/commitdiff
Clear bibfile cache when set of bibliography files change
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Oct 2018 09:06:24 +0000 (11:06 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Oct 2018 09:06:24 +0000 (11:06 +0200)
Part of #9158

src/Buffer.cpp
src/Buffer.h
src/insets/InsetBibtex.cpp

index 64e4e0fb042f825c3413f46cd09b7c52c70c557c..2809fdf8b7b45c400d5daf6c3335e03227dd1a6f 100644 (file)
@@ -2492,6 +2492,12 @@ void Buffer::checkIfBibInfoCacheIsValid() const
 }
 
 
+void Buffer::clearBibFileCache() const
+{
+       bibfileCache.clear();
+}
+
+
 void Buffer::reloadBibInfoCache(bool const force) const
 {
        // use the master's cache
@@ -2511,7 +2517,7 @@ void Buffer::reloadBibInfoCache(bool const force) const
        // FIXME Is this sufficient? Or should we also force that
        // in some other cases? If so, then it is easy enough to
        // add the following line in some other places.
-       bibfileCache.clear();
+       clearBibFileCache();
        d->bibinfo_.clear();
        FileNameList checkedFiles;
        collectBibKeys(checkedFiles);
index c68f09de99f9acf8bdef4be83d1a4af2c919332d..4037e5a1e60861b711e6728fa3ace1c6f50f6168 100644 (file)
@@ -500,6 +500,8 @@ public:
        /// Calling this method invalidates the cache and so requires a
        /// re-read.
        void invalidateBibinfoCache() const;
+       /// Clear the bibfiles cache
+       void clearBibFileCache() const;
        /// Updates the cached bibliography information, checking first to see
        /// whether the cache is valid. If so, we do nothing. If not, then we
        /// reload all the BibTeX info.
index d5798630a75a693f645c2ef2d15ac24e9b3c5b63..ae76a7f26c0c2bd7e8270fc35e322f3ec501e63c 100644 (file)
@@ -105,6 +105,7 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
 
                cur.recordUndo();
                setParams(p);
+               cur.buffer()->clearBibFileCache();
                cur.forceBufferUpdate();
                break;
        }