Fix bug #8087: Include children in plaintext export.

This commit is contained in:
Richard Heck 2012-03-19 17:33:47 -04:00
parent 3380e0de8f
commit 98a810c9d8

View File

@ -34,6 +34,7 @@
#include "LyXRC.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "output_plaintext.h"
#include "output_xhtml.h"
#include "OutputParams.h"
#include "TextClass.h"
@ -804,7 +805,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
}
int InsetInclude::plaintext(odocstream & os, OutputParams const &) const
int InsetInclude::plaintext(odocstream & os, OutputParams const & op) const
{
if (isVerbatim(params()) || isListings(params())) {
os << '[' << screenLabel() << '\n';
@ -812,11 +813,15 @@ int InsetInclude::plaintext(odocstream & os, OutputParams const &) const
os << includedFileName(buffer(), params()).fileContents("UTF-8");
os << "\n]";
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
} else {
}
Buffer const * const ibuf = loadIfNeeded();
if (!ibuf) {
docstring const str = '[' + screenLabel() + ']';
os << str;
return str.size();
}
writePlaintextFile(*ibuf, os, op);
}