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 void Buffer::checkIfBibInfoCacheIsValid() const
{ {
// use the master's cache // 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 // do this only if we are the top-level Buffer
if (master == this) if (master == this)
checkIfBibInfoCacheIsValid(); reloadBibInfoCache();
// keep the buffers to be children in this set. If the call from the // 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. // 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 /// whether the cache is valid. If so, we do nothing. If not, then we
/// reload all the BibTeX info. /// reload all the BibTeX info.
/// Note that this operates on the master document. /// 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; void reloadBibInfoCache() const;
/// Was the cache valid the last time we checked?
bool isBibInfoCacheValid() const;
/// \return the bibliography information for this buffer's master, /// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child. /// or just for it, if it isn't a child.
BiblioInfo const & masterBibInfo() const; BiblioInfo const & masterBibInfo() const;

View File

@ -334,13 +334,6 @@ void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype)
} else { } else {
autolabel_ = from_ascii("??"); 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 int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
{ {
// the sequence of the commands: // the sequence of the commands:

View File

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