InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & b)
+ : include_label(unique_id())
{
params_.cparams = p;
params_.masterFilename_ = b.fileName();
- include_label = unique_id();
}
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".sgml");
- if (!buffer->tmppath.empty() && !buffer->niceFile) {
+ if (!buffer->tmppath.empty() && buffer->niceFile) {
incfile = subst(incfile, '/','@');
writefile = AddName(buffer->tmppath, incfile);
} else
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".sgml");
- if (!buffer->tmppath.empty() && !buffer->niceFile) {
+ if (!buffer->tmppath.empty() && buffer->niceFile) {
incfile = subst(incfile, '/','@');
writefile = AddName(buffer->tmppath, incfile);
} else
Buffer const * const b = bufferlist.getBuffer(getMasterFilename());
- if (!b->isSGML()) {
- if (b && !b->tmppath.empty() && b->niceFile) {
- incfile = subst(incfile, '/','@');
- writefile = AddName(b->tmppath, incfile);
- } else
- writefile = getFileName();
- } else {
+ if (b && !b->tmppath.empty() && b->niceFile && !isVerbatim()) {
+ incfile = subst(incfile, '/','@');
+ writefile = AddName(b->tmppath, incfile);
+ } else
writefile = getFileName();
- if (IsLyXFilename(getFileName()))
- writefile = ChangeExtension(writefile, ".sgml");
- }
+ if (IsLyXFilename(getFileName()))
+ writefile = ChangeExtension(writefile, ".sgml");
features.includeFile(include_label, writefile);