#include "LyXRC.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_plaintext.h"
#include "output_xhtml.h"
#include "OutputParams.h"
#include "TextClass.h"
runparams.master_language = buffer().params().language;
runparams.par_begin = 0;
runparams.par_end = tmp->paragraphs().size();
+ runparams.is_child = true;
if (!tmp->makeLaTeXFile(tmpwritefile, masterFileName(buffer()).
onlyPath().absFileName(), runparams, Buffer::OnlyBody)) {
docstring msg = bformat(_("Included file `%1$s' "
}
runparams.encoding = oldEnc;
runparams.master_language = oldLang;
+ runparams.is_child = false;
// If needed, use converters to produce a latex file from the child
if (tmpwritefile != writefile) {
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
<< "<!-- Included file: "
}
-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';
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);
+ return 0;
}
// otherwise it would always be the master buffer,
// and nested includes would not work.
features.setBuffer(*tmp);
+ features.runparams().is_child = true;
tmp->validate(features);
+ features.runparams().is_child = false;
features.setBuffer(buffer());
}
}
void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
{
+ button_.update(screenLabel(), true);
+
Buffer const * const childbuffer = getChildBuffer();
if (childbuffer) {
childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype);