Delay bibfileCache first update up until it is used.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16606 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-01-08 13:36:01 +00:00
parent 10917a7b09
commit 2b378ca3fd
2 changed files with 5 additions and 1 deletions

View File

@ -1286,6 +1286,10 @@ vector<FileName> const & Buffer::getBibfilesCache() const
if (tmp != this) if (tmp != this)
return tmp->getBibfilesCache(); return tmp->getBibfilesCache();
// We update the cache when first used instead of at loading time.
if (bibfilesCache_.empty())
const_cast<Buffer *>(this)->updateBibfilesCache();
return bibfilesCache_; return bibfilesCache_;
} }

View File

@ -383,7 +383,7 @@ private:
StableDocIterator anchor_; StableDocIterator anchor_;
/// A cache for the bibfiles (including bibfiles of loaded child /// A cache for the bibfiles (including bibfiles of loaded child
/// documents), needed for appropriate update of natbib labels. /// documents), needed for appropriate update of natbib labels.
std::vector<support::FileName> bibfilesCache_; mutable std::vector<support::FileName> bibfilesCache_;
/// Container for all sort of Buffer dependant errors. /// Container for all sort of Buffer dependant errors.
std::map<std::string, ErrorList> errorLists_; std::map<std::string, ErrorList> errorLists_;