updateBuffer() traversal. The reason is simple: InsetCitation needs
access to the BibTeX info to calculate its label. But we won't have it
until we get to the bibliography.
I don't think there is any way around that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36710
a592a061-630c-0410-9148-
cb99ea01b6c8
}
-bool Buffer::isBibInfoCacheValid() const
-{
- // use the master's cache
- Buffer const * const tmp = masterBuffer();
- if (tmp != this)
- return tmp->isBibInfoCacheValid();
- return d->bibinfo_cache_valid_;
-}
-
-
void Buffer::checkIfBibInfoCacheIsValid() const
{
// use the master's cache
// do this only if we are the top-level Buffer
if (master == this)
- checkIfBibInfoCacheIsValid();
+ reloadBibInfoCache();
// 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.
/// whether the cache is valid. If so, we do nothing. If not, then we
/// reload all the BibTeX info.
/// Note that this operates on the master document.
- /// Normally, this is done (more cheaply) in updateBuffer(), but there are
- /// times when we need to force it to be done and don't need a full buffer
- /// update. This is in GuiCitation and in changeRefsIfUnique() now.
void reloadBibInfoCache() const;
- /// Was the cache valid the last time we checked?
- bool isBibInfoCacheValid() const;
/// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child.
BiblioInfo const & masterBibInfo() const;
} else {
autolabel_ = from_ascii("??");
}
- if (!buffer().isBibInfoCacheValid()) {
- docstring const key = getParam("key");
- BibTeXInfo keyvalmap(false);
- keyvalmap.label(bibLabel());
- keyvalmap[from_ascii("ref")] = it.paragraph().asString();
- buffer().addBibTeXInfo(key, keyvalmap);
- }
}
}
-void InsetBibtex::updateBuffer(ParIterator const &, UpdateType)
-{
- if (buffer().isBibInfoCacheValid())
- return;
- parseBibTeXFiles();
-}
-
-
int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
{
// the sequence of the commands:
///
int latex(odocstream &, OutputParams const &) const;
///
- void updateBuffer(ParIterator const &, UpdateType);
- ///
void collectBibKeys(InsetIterator const &) const;
///
void validate(LaTeXFeatures &) const;