Revert r36696: We can't collect BibTeX information during the

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
This commit is contained in:
Richard Heck 2010-12-04 03:15:53 +00:00
parent 7e33edc3c3
commit 3fffe51506
5 changed files with 1 additions and 33 deletions

View File

@ -1809,16 +1809,6 @@ BiblioInfo const & Buffer::masterBibInfo() const
}
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
@ -3867,7 +3857,7 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
// 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.

View File

@ -446,12 +446,7 @@ public:
/// 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;

View File

@ -334,13 +334,6 @@ void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype)
} 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);
}
}

View File

@ -234,14 +234,6 @@ static string normalizeName(Buffer const & buffer,
}
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:

View File

@ -52,8 +52,6 @@ public:
///
int latex(odocstream &, OutputParams const &) const;
///
void updateBuffer(ParIterator const &, UpdateType);
///
void collectBibKeys(InsetIterator const &) const;
///
void validate(LaTeXFeatures &) const;