From eb14ee5e22ed0a007f5b756694c02ad0fe4069b0 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 15 Aug 2007 08:55:36 +0000 Subject: [PATCH] * Buffer.cpp: load all child documents in one go where it makes sense. This has the advantage to call updateLabels() only once for the master buffer. We can think of maintaining a child document list in the future. * Biblio.cpp: fillWithBibKeys(): ditto. * InsetInclude.cpp: loadIfNeeded(): set the parent name in any case. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19586 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Biblio.cpp | 4 ++++ src/Buffer.cpp | 8 ++++++++ src/insets/InsetInclude.cpp | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Biblio.cpp b/src/Biblio.cpp index 1ab9dd0780..000792d7d0 100644 --- a/src/Biblio.cpp +++ b/src/Biblio.cpp @@ -14,6 +14,7 @@ #include "Biblio.h" +#include "buffer_funcs.h" #include "gettext.h" #include "InsetIterator.h" #include "Paragraph.h" @@ -845,6 +846,9 @@ void fillWithBibKeys(Buffer const * const buf, return; } + // Pre-load all child documents. + loadChildDocuments(*buf); + for (InsetIterator it = inset_iterator_begin(buf->inset()); it; ++it) it->fillWithBibKeys(*buf, keys, it); } diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 18ce36f4d3..ae0dccaf02 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1058,6 +1058,8 @@ void Buffer::writeLaTeXSource(odocstream & os, params().parentname.erase(); } + loadChildDocuments(*this); + // the real stuff latexParagraphs(*this, paragraphs(), os, texrow(), runparams); @@ -1209,6 +1211,8 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname, params().getTextClass().counters().reset(); + loadChildDocuments(*this); + sgml::openTag(os, top); os << '\n'; docbookParagraphs(paragraphs(), *this, os, runparams); @@ -1298,6 +1302,8 @@ void Buffer::validate(LaTeXFeatures & features) const if (params().use_esint == BufferParams::package_on) features.require("esint"); + loadChildDocuments(*this); + for_each(paragraphs().begin(), paragraphs().end(), boost::bind(&Paragraph::validate, _1, boost::ref(features))); @@ -1345,6 +1351,8 @@ void Buffer::getLabelList(vector & list) const return; } + loadChildDocuments(*this); + for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) it.nextInset()->getLabelList(*this, list); } diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 4b7ef4e055..3af1e3d862 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -414,7 +414,6 @@ Buffer * loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params) return false; } } - return buf; } buf->setParentName(parentFilename(buffer)); return buf;