+
+void loadChildDocuments(Buffer const & buf)
+{
+ bool parse_error = false;
+
+ for (InsetIterator it = inset_iterator_begin(buf.inset()); it; ++it) {
+ if (it->lyxCode() != Inset::INCLUDE_CODE)
+ continue;
+ InsetInclude const & inset = static_cast<InsetInclude const &>(*it);
+ InsetCommandParams const & ip = inset.params();
+ Buffer * child = loadIfNeeded(buf, ip);
+ if (!child)
+ continue;
+ parse_error |= !child->errorList("Parse").empty();
+ loadChildDocuments(*child);
+ }
+
+ if (use_gui && buf.getMasterBuffer() == &buf)
+ updateLabels(buf);
+}
+