}
case 1:
- if(!current_view->buffer()->isReadonly()) {
+ if (!current_view->buffer()->isReadonly()) {
inset->setContents(fl_get_input(form->input));
// don't typeset
inset->setNoLoad(fl_get_button(form->flag1));
fl_hide_form(form->include);
break;
case 5:
- if(!current_view->buffer()->isReadonly()) {
+ if (!current_view->buffer()->isReadonly()) {
inset->setContents(fl_get_input(form->input));
inset->setNoLoad(fl_get_button(form->flag1));
if (fl_get_button(form->flag2))
}
-InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer * bf)
- : InsetCommand(p), master(bf)
+InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & bf)
+ : InsetCommand(p), master(&bf)
{
flag = InsetInclude::INCLUDE;
noload = false;
}
-Inset * InsetInclude::Clone() const
+Inset * InsetInclude::Clone(Buffer const & buffer) const
{
- InsetInclude * ii = new InsetInclude (params(), master);
+ InsetInclude * ii = new InsetInclude (params(), buffer);
ii->setNoLoad(isNoLoad());
// By default, the newly created inset is of `include' type,
// so we do not test this case.
void InsetInclude::Edit(BufferView * bv, int, int, unsigned int)
{
- if(bv->buffer()->isReadonly())
+ if (bv->buffer()->isReadonly())
WarnReadonly(bv->buffer()->fileName());
if (!form) {
form = create_form_include();
- fl_set_form_atclose(form->include, IgnoreCloseBoxCB, 0);
+ fl_set_form_atclose(form->include, CancelCloseBoxCB, 0);
}
form->include->u_vdata = this;
if (form->include->visible) {
fl_raise_form(form->include);
} else {
- fl_show_form(form->include, FL_PLACE_MOUSE, FL_FULLBORDER,
+ fl_show_form(form->include,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
_("Include"));
}
}
} else
writefile = getFileName();
- if(IsLyXFilename(getFileName()))
+ if (IsLyXFilename(getFileName()))
writefile = ChangeExtension(writefile, ".sgml");
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
}
if (isVerb()) {
- os << "<!-- includefile verbatim=\"" << incfile << "\" -->";
+ os << "<inlinegraphic fileref=\"" << '&' << include_label << ';'
+ << "\" format=\"linespecific\">"
+ << "</inlinegraphic>";
} else
os << '&' << include_label << ';';
writefile = AddName(buffer->tmppath, incfile);
} else
writefile = getFileName();
- if(IsLyXFilename(getFileName()))
+ if (IsLyXFilename(getFileName()))
writefile = ChangeExtension(writefile, ".sgml");
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
}
if (isVerb()) {
- os << "<inlinegraphic fileref=\"" << incfile << "\" format=\"linespecific\">";
+ os << "<inlinegraphic fileref=\"" << '&' << include_label << ';'
+ << "\" format=\"linespecific\">"
+ << "</inlinegraphic>";
} else
os << '&' << include_label << ';';
{
string incfile(getContents());
- string writefile = ChangeExtension(getFileName(), ".sgml");
+ string writefile; // = ChangeExtension(getFileName(), ".sgml");
+
if (!master->tmppath.empty() && !master->niceFile) {
incfile = subst(incfile, '/','@');
writefile = AddName(master->tmppath, incfile);
} else
- // writefile = getFileName();
+ writefile = getFileName();
// Use the relative path.
- writefile = incfile;
+ //writefile = incfile;
- if(IsLyXFilename(getFileName()))
+ if (IsLyXFilename(getFileName()))
writefile = ChangeExtension(writefile, ".sgml");
features.IncludedFiles[include_label] = writefile;