#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, false)) {
+ onlyPath().absFileName(), runparams, Buffer::OnlyBody)) {
docstring msg = bformat(_("Included file `%1$s' "
"was not exported correctly.\nWarning: "
"LaTeX export is probably incomplete."),
}
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, true);
+ 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;
}
LYXERR(Debug::LATEX, "exportfile:" << exportfile);
LYXERR(Debug::LATEX, "writefile:" << writefile);
- tmp->makeDocBookFile(writefile, runparams, true);
+ tmp->makeDocBookFile(writefile, runparams, Buffer::OnlyBody);
}
runparams.exportdata->addExternalFile("docbook", writefile,
features.includeFile(include_label, writefile);
+ features.useInsetLayout(getLayout());
if (isVerbatim(params()))
features.require("verbatim");
else if (isListings(params()))
// 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());
}
}
}
+docstring InsetInclude::layoutName() const
+{
+ if (isListings(params()))
+ return from_ascii("IncludeListings");
+ return InsetCommand::layoutName();
+}
+
//
// preview stuff
void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
{
+ button_.update(screenLabel(), true);
+
Buffer const * const childbuffer = getChildBuffer();
if (childbuffer) {
childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype);