From 4509607bf6bc528fba3066da3f9e7abaf142f1e1 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 9 Aug 2010 16:18:57 +0000 Subject: [PATCH] Do not invalidate cache unless we find some BibTeX insets. Part of #6846. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35102 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 15e05177f3..d4037ee181 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1711,19 +1711,23 @@ void Buffer::updateBibfilesCache(UpdateScope scope) const d->bibfiles_cache_.insert(d->bibfiles_cache_.end(), bibfiles.begin(), bibfiles.end()); + // the bibinfo cache is now invalid + d->bibinfo_cache_valid_ = false; } else if (it->lyxCode() == INCLUDE_CODE) { InsetInclude & inset = static_cast(*it); inset.updateBibfilesCache(); support::FileNameList const & bibfiles = inset.getBibfilesCache(); - d->bibfiles_cache_.insert(d->bibfiles_cache_.end(), - bibfiles.begin(), - bibfiles.end()); + if (!bibfiles.empty()) { + d->bibfiles_cache_.insert(d->bibfiles_cache_.end(), + bibfiles.begin(), + bibfiles.end()); + // the bibinfo cache is now invalid + d->bibinfo_cache_valid_ = false; + } } } - // the bibinfo cache is now invalid - d->bibinfo_cache_valid_ = false; } -- 2.39.2