]> git.lyx.org Git - lyx.git/commitdiff
Do not invalidate cache unless we find some BibTeX insets. Part of
authorRichard Heck <rgheck@comcast.net>
Mon, 9 Aug 2010 16:18:57 +0000 (16:18 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 9 Aug 2010 16:18:57 +0000 (16:18 +0000)
#6846.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35102 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 15e05177f3bad8d2353b54c0fe3c51fab46aeeb3..d4037ee181f0d2d098b60a4c2a3056e3bb76f153 100644 (file)
@@ -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<InsetInclude &>(*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;
 }