return;
d->bibinfo_.clear();
- collectBibKeys();
+ FileNameList checkedFiles;
+ collectBibKeys(checkedFiles);
d->bibinfo_cache_valid_ = true;
}
-void Buffer::collectBibKeys() const
+void Buffer::collectBibKeys(FileNameList & checkedFiles) const
{
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it)
- it->collectBibKeys(it);
+ it->collectBibKeys(it, checkedFiles);
}
#include "support/unique_ptr.h"
#include "support/strfwd.h"
#include "support/types.h"
+#include "support/FileNameList.h"
#include <map>
#include <list>
/// or just for it, if it isn't a child.
BiblioInfo const & masterBibInfo() const;
/// collect bibliography info from the various insets in this buffer.
- void collectBibKeys() const;
+ void collectBibKeys(support::FileNameList &) const;
/// add some BiblioInfo to our cache
void addBiblioInfo(BiblioInfo const & bi) const;
/// add a single piece of bibliography info to our cache
#include "support/strfwd.h"
#include "support/types.h"
+#include "support/FileNameList.h"
#include <climits>
UpdateType /* utype*/,
TocBackend & /* tocbackend */) const {}
/// Collect BibTeX information
- virtual void collectBibKeys(InsetIterator const &) const {}
+ virtual void collectBibKeys(InsetIterator const &, support::FileNameList &) const {}
/// Update the counters of this inset and of its contents.
/// The boolean indicates whether we are preparing for output, e.g.,
/// of XHTML.
}
-void InsetBibitem::collectBibKeys(InsetIterator const & it) const
+void InsetBibitem::collectBibKeys(InsetIterator const & it, FileNameList & /*checkedFiles*/) const
{
docstring const key = getParam("key");
docstring const label = getParam("label");
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
///
- void collectBibKeys(InsetIterator const &) const;
+ void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
/// update the counter of this inset
void updateBuffer(ParIterator const &, UpdateType);
///@}
} // namespace
-void InsetBibtex::collectBibKeys(InsetIterator const & /*di*/) const
+void InsetBibtex::collectBibKeys(InsetIterator const & /*di*/, FileNameList & checkedFiles) const
{
- parseBibTeXFiles();
+ parseBibTeXFiles(checkedFiles);
}
-void InsetBibtex::parseBibTeXFiles() const
+void InsetBibtex::parseBibTeXFiles(FileNameList & checkedFiles) const
{
// This bibtex parser is a first step to parse bibtex files
// more precisely.
support::FileNamePairList::const_iterator it = files.begin();
support::FileNamePairList::const_iterator en = files.end();
for (; it != en; ++ it) {
- ifdocstream ifs(it->second.toFilesystemEncoding().c_str(),
+ FileName const bibfile = it->second;
+ if (find(checkedFiles.begin(), checkedFiles.end(), bibfile) != checkedFiles.end())
+ // already checked this one. Skip.
+ continue;
+ else
+ // record that we check this.
+ checkedFiles.push_back(bibfile);
+ ifdocstream ifs(bibfile.toFilesystemEncoding().c_str(),
ios_base::in, buffer().masterParams().encoding().iconvName());
char_type ch;
int plaintext(odocstringstream & ods, OutputParams const & op,
size_t max_length = INT_MAX) const;
///
- void collectBibKeys(InsetIterator const &) const;
+ void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
///
void validate(LaTeXFeatures &) const;
///
///
void editDatabases() const;
///
- void parseBibTeXFiles() const;
+ void parseBibTeXFiles(support::FileNameList &) const;
///
bool usingBiblatex() const;
}
-void InsetInclude::collectBibKeys(InsetIterator const & /*di*/) const
+void InsetInclude::collectBibKeys(InsetIterator const & /*di*/, FileNameList & checkedFiles) const
{
Buffer * child = loadIfNeeded();
if (!child)
// But it'll have to do for now.
if (child == &buffer())
return;
- child->collectBibKeys();
+ child->collectBibKeys(checkedFiles);
}
* \param keys the list of bibkeys in the child buffer.
* \param it not used here
*/
- void collectBibKeys(InsetIterator const &) const;
+ void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
///
bool hasSettings() const { return true; }
///