- Toc::const_iterator toc_it = toc->begin();
- Toc::const_iterator end = toc->end();
- for (; toc_it != end; ++toc_it) {
- if (toc_it->depth() == 0)
- list.push_back(toc_it->str());
- }
-}
-
-
-void Buffer::updateBibfilesCache(UpdateScope scope) const
-{
- // FIXME This is probably unnecssary, given where we call this.
- // If this is a child document, use the parent's cache instead.
- if (parent() && scope != UpdateChildOnly) {
- masterBuffer()->updateBibfilesCache();
- return;
- }
-
- d->bibfiles_cache_.clear();
- for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
- if (it->lyxCode() == BIBTEX_CODE) {
- InsetBibtex const & inset = static_cast<InsetBibtex const &>(*it);
- support::FileNamePairList const bibfiles = inset.getBibFiles();
- d->bibfiles_cache_.insert(d->bibfiles_cache_.end(),
- bibfiles.begin(),
- bibfiles.end());
- } else if (it->lyxCode() == INCLUDE_CODE) {
- InsetInclude & inset = static_cast<InsetInclude &>(*it);
- Buffer const * const incbuf = inset.getChildBuffer();
- if (!incbuf)
- continue;
- support::FileNamePairList const & bibfiles =
- incbuf->getBibfilesCache(UpdateChildOnly);
- if (!bibfiles.empty()) {
- d->bibfiles_cache_.insert(d->bibfiles_cache_.end(),
- bibfiles.begin(),
- bibfiles.end());
- }
- }