]> git.lyx.org Git - features.git/commitdiff
Revert r36696: We can't collect BibTeX information during the
authorRichard Heck <rgheck@comcast.net>
Sat, 4 Dec 2010 03:15:53 +0000 (03:15 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 4 Dec 2010 03:15:53 +0000 (03:15 +0000)
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
src/Buffer.h
src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetBibtex.h

index 230d75b4038108c261b83fd086844e6bdfd2c2b6..476d70bcd6b1138cf0e876612b0f612817e7b990 100644 (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.
index a13f0c5db0c671b1d6acfcf70c26e98a6fb5c718..393951403147be7ca8f08b8b617dba021db6e5e8 100644 (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;
index 0fbc516240bb69c59ec8d5659482112f59c66169..11ba38c7e86fad29bab4706c7523845ba7d81f40 100644 (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);
-       }
 }
 
 
index dc022f1e242670cff834b56ed0bf9c2006a69b33..ebabdbdb13970820152b6b29f5e9e550015140e4 100644 (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:
index ea0cecfc142d4fc3a483a27d6330684a4e80c7e1..73141f455d08fdef935c940163bbbc5e8052bd9f 100644 (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;