From 3fffe51506cf96329622e581759fc6ab9a0f6211 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 4 Dec 2010 03:15:53 +0000 Subject: [PATCH] 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 --- src/Buffer.cpp | 12 +----------- src/Buffer.h | 5 ----- src/insets/InsetBibitem.cpp | 7 ------- src/insets/InsetBibtex.cpp | 8 -------- src/insets/InsetBibtex.h | 2 -- 5 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 230d75b403..476d70bcd6 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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. diff --git a/src/Buffer.h b/src/Buffer.h index a13f0c5db0..3939514031 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -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; diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index 0fbc516240..11ba38c7e8 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -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); - } } diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index dc022f1e24..ebabdbdb13 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -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: diff --git a/src/insets/InsetBibtex.h b/src/insets/InsetBibtex.h index ea0cecfc14..73141f455d 100644 --- a/src/insets/InsetBibtex.h +++ b/src/insets/InsetBibtex.h @@ -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; -- 2.39.2