From: Richard Heck Date: Fri, 8 Jan 2010 18:18:05 +0000 (+0000) Subject: Fix a BibTeX caching bug. Because we only set the last modified time X-Git-Tag: 2.0.0~4497 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=295b84e8fb7cf18867a26923f2224167c99f49de;p=features.git Fix a BibTeX caching bug. Because we only set the last modified time when the cache was valid, we did not set it the first time through and so always read the cache twice. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32890 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d922ae7eb7..9b8730d465 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1647,18 +1647,16 @@ BiblioInfo const & Buffer::localBibInfo() const void Buffer::checkBibInfoCache() const { - if (d->bibinfoCacheValid_) { - support::FileNameList const & bibfilesCache = getBibfilesCache(); - // compare the cached timestamps with the actual ones. - support::FileNameList::const_iterator ei = bibfilesCache.begin(); - support::FileNameList::const_iterator en = bibfilesCache.end(); - for (; ei != en; ++ ei) { - time_t lastw = ei->lastModified(); - if (lastw != d->bibfileStatus_[*ei]) { - d->bibinfoCacheValid_ = false; - d->bibfileStatus_[*ei] = lastw; - break; - } + support::FileNameList const & bibfilesCache = getBibfilesCache(); + // compare the cached timestamps with the actual ones. + support::FileNameList::const_iterator ei = bibfilesCache.begin(); + support::FileNameList::const_iterator en = bibfilesCache.end(); + for (; ei != en; ++ ei) { + time_t lastw = ei->lastModified(); + time_t prevw = d->bibfileStatus_[*ei]; + if (lastw != prevw) { + d->bibinfoCacheValid_ = false; + d->bibfileStatus_[*ei] = lastw; } }