BiblioInfo const & Buffer::localBibInfo() const
{
- checkBibInfoCache();
return d->bibinfo_;
}
// Check if the label 'from' appears more than once
vector<docstring> labels;
string paramName;
+ checkBibInfoCache();
BiblioInfo const & keys = masterBibInfo();
BiblioInfo::const_iterator bit = keys.begin();
BiblioInfo::const_iterator bend = keys.end();
// Use the master text class also for child documents
Buffer const * const master = masterBuffer();
DocumentClass const & textclass = master->params().documentClass();
+
+ // do this only if we are the top-level Buffer
+ if (scope != UpdateMaster || master == this)
+ checkBibInfoCache();
// keep the buffers to be children in this set. If the call from the
// master comes back we can see which of them were actually seen (i.e.
*/
void validate(LaTeXFeatures &) const;
- /// Update the cache with all bibfiles in use (including bibfiles
+ /// Update the list of all bibfiles in use (including bibfiles
/// of loaded child documents).
void updateBibfilesCache(UpdateScope scope = UpdateMaster) const;
- ///
- void invalidateBibinfoCache();
- /// Return the cache with all bibfiles in use (including bibfiles
+ /// Return the list with all bibfiles in use (including bibfiles
/// of loaded child documents).
support::FileNameList const &
getBibfilesCache(UpdateScope scope = UpdateMaster) const;
+ /// Information from BibTeX databases is cached in the Buffer, so
+ /// we do not have to read the file over and over.
+ /// Calling this method invalidates the cache and so requires a
+ /// re-read.
+ void invalidateBibinfoCache();
+ /// Updates the cached bibliography information.
+ /// Note that you MUST call this method to update the cache. It will
+ /// not happen otherwise. (Currently, it is called at the start of
+ /// updateLabels() and from GuiCitation.)
+ void checkBibInfoCache() const;
/// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child.
BiblioInfo const & masterBibInfo() const;
void updateMacros(DocIterator & it,
DocIterator & scope) const;
///
- void checkBibInfoCache() const;
- ///
void setLabel(ParIterator & it) const;
///
void collectRelatives(BufferSet & bufs) const;