Restore buffer parenthood if we exit already after the preamble

This commit is contained in:
Juergen Spitzmueller 2012-10-05 19:26:07 +02:00
parent e6afdf1b2b
commit 63612ca99b
2 changed files with 5 additions and 3 deletions

View File

@ -1592,8 +1592,12 @@ void Buffer::writeLaTeXSource(otexstream & os,
runparams.use_japanese = features.isRequired("japanese");
if (!output_body)
if (!output_body) {
// Restore the parenthood if needed
if (!runparams.is_child)
d->ignore_parent = false;
return;
}
// make the body.
os << "\\begin{document}\n";

View File

@ -716,8 +716,6 @@ void PreviewLoader::Impl::dumpPreamble(otexstream & os) const
runparams.nice = true;
runparams.moving_arg = true;
runparams.free_spacing = true;
if (buffer_.parent())
runparams.is_child = true;
buffer_.writeLaTeXSource(os, buffer_.filePath(), runparams, Buffer::OnlyPreamble);
// FIXME! This is a HACK! The proper fix is to control the 'true'