/// is this an unnamed file (New...)?
bool unnamed;
+ /// is this an internal bufffer?
+ bool internal_buffer;
+
/// buffer is r/o
bool read_only;
Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
Buffer const * cloned_buffer)
: owner_(owner), lyx_clean(true), bak_clean(true), unnamed(false),
- read_only(readonly_), filename(file), file_fully_loaded(false),
- toc_backend(owner), macro_lock(false), timestamp_(0), checksum_(0),
- wa_(0), gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
- bibfile_cache_valid_(false), cite_labels_valid_(false),
- preview_loader_(0), cloned_buffer_(cloned_buffer), clone_list_(0),
+ internal_buffer(false), read_only(readonly_), filename(file),
+ file_fully_loaded(false), toc_backend(owner), macro_lock(false),
+ timestamp_(0), checksum_(0), wa_(0), gui_(0), undo_(*owner),
+ bibinfo_cache_valid_(false), bibfile_cache_valid_(false),
+ cite_labels_valid_(false), preview_loader_(0),
+ cloned_buffer_(cloned_buffer), clone_list_(0),
doing_export(false), parent_buffer(0)
{
if (!cloned_buffer_) {
bibfile_status_ = cloned_buffer_->d->bibfile_status_;
cite_labels_valid_ = cloned_buffer_->d->cite_labels_valid_;
unnamed = cloned_buffer_->d->unnamed;
+ internal_buffer = cloned_buffer_->d->internal_buffer;
}
params().html_latex_end.clear();
params().html_math_img_scale = 1.0;
params().output_sync_macro.erase();
+ params().local_layout.clear();
for (int i = 0; i < 4; ++i) {
params().user_defined_bullet(i) = ITEMIZE_DEFAULTS[i];
Encoding const * const enc = runparams.encoding;
if (enc) {
for (size_t n = 0; n < inputpath.size(); ++n) {
- docstring const glyph =
- docstring(1, inputpath[n]);
- if (enc->latexChar(inputpath[n], true) != glyph) {
+ if (!enc->encodable(inputpath[n])) {
+ docstring const glyph(1, inputpath[n]);
LYXERR0("Uncodable character '"
<< glyph
<< "' in input path!");
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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
}
if (output_body) {
- os << "<body>\n";
+ bool const output_body_tag = (output != IncludedFile);
+ if (output_body_tag)
+ os << "<body>\n";
XHTMLStream xs(os);
params().documentClass().counters().reset();
xhtmlParagraphs(text(), *this, xs, runparams);
- os << "</body>\n";
+ if (output_body_tag)
+ os << "</body>\n";
}
if (output_preamble)
/// retrieving fileName() nor for checking if it is unnamed or not.
bool Buffer::isInternal() const
{
- return fileName().extension() == "internal";
+ return d->internal_buffer;
+}
+
+
+void Buffer::setInternal(bool flag)
+{
+ d->internal_buffer = flag;
}
texrow.newline();
texrow.newline();
// output paragraphs
- if (params().isDocBook())
- docbookParagraphs(text(), *this, os, runparams);
- else if (runparams.flavor == OutputParams::HTML) {
+ if (runparams.flavor == OutputParams::HTML) {
XHTMLStream xs(os);
setMathFlavor(runparams);
xhtmlParagraphs(text(), *this, xs, runparams);
// Probably should have some routine with a signature like them.
writePlaintextParagraph(*this,
text().paragraphs()[par_begin], os, runparams, dummy);
+ } else if (params().isDocBook()) {
+ docbookParagraphs(text(), *this, os, runparams);
} else {
// latex or literate
otexstream ots(os, texrow);
d->texrow.reset();
d->texrow.newline();
d->texrow.newline();
- if (params().isDocBook())
- writeDocBookSource(os, absFileName(), runparams, output);
- else if (runparams.flavor == OutputParams::HTML)
+ if (runparams.flavor == OutputParams::HTML) {
writeLyXHTMLSource(os, runparams, output);
- else {
+ } else if (runparams.flavor == OutputParams::TEXT) {
+ if (output == OnlyPreamble) {
+ os << _("% Plaintext does not have a preamble.");
+ } else
+ writePlaintextFile(*this, os, runparams);
+ } else if (params().isDocBook()) {
+ writeDocBookSource(os, absFileName(), runparams, output);
+ } else {
// latex or literate
otexstream ots(os, d->texrow);
writeLaTeXSource(ots, string(), runparams, output);
}
return ExportNoPathToFormat;
}
- runparams.flavor = converters.getFlavor(path);
+ runparams.flavor = converters.getFlavor(path, this);
} else {
backend_format = format;
return ExportTexPathHasSpaces;
} else {
runparams.nice = false;
- bool const success = makeLaTeXFile(FileName(filename), string(), runparams);
+ bool const success = makeLaTeXFile(
+ FileName(filename), filePath(), runparams);
if (d->cloned_buffer_)
d->cloned_buffer_->d->errorLists["Export"] = d->errorLists["Export"];
if (!success)