From ddee4f872bb3d1edf643ce2def2ecd256074ac2c Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 23 Apr 2012 13:55:13 -0400 Subject: [PATCH] Don't output extra body tags with included files. --- src/Buffer.cpp | 9 ++++++--- src/Buffer.h | 1 + src/insets/InsetInclude.cpp | 2 +- status.20x | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 2ee9422713..e863ce3bcf 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1735,7 +1735,7 @@ void Buffer::writeLyXHTMLSource(odocstream & os, bool const output_preamble = output == FullSource || output == OnlyPreamble; bool const output_body = - output == FullSource || output == OnlyBody; + output == FullSource || output == OnlyBody || output == IncludedFile; if (output_preamble) { os << "\n" @@ -1785,11 +1785,14 @@ void Buffer::writeLyXHTMLSource(odocstream & os, } if (output_body) { - os << "\n"; + bool const output_body_tag = (output != IncludedFile); + if (output_body_tag) + os << "\n"; XHTMLStream xs(os); params().documentClass().counters().reset(); xhtmlParagraphs(text(), *this, xs, runparams); - os << "\n"; + if (output_body_tag) + os << "\n"; } if (output_preamble) diff --git a/src/Buffer.h b/src/Buffer.h index 4249045600..66b9b28486 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -278,6 +278,7 @@ public: enum OutputWhat { FullSource, OnlyBody, + IncludedFile, OnlyPreamble, CurrentParagraph }; diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 559baff07a..568449790c 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -785,7 +785,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const if (all_pars) { op.par_begin = 0; op.par_end = 0; - ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::OnlyBody); + ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::IncludedFile); } else xs << XHTMLStream::ESCAPE_NONE << "