}
-void InsetInclude::write(Buffer const *, ostream & os) const
+void InsetInclude::write(Buffer const &, ostream & os) const
+{
+ write(os);
+}
+
+
+void InsetInclude::write(ostream & os) const
{
os << "Include " << params_.cparams.getCommand() << '\n'
<< "preview " << tostr(params_.cparams.preview()) << '\n';
}
-void InsetInclude::read(Buffer const *, LyXLex & lex)
+void InsetInclude::read(Buffer const &, LyXLex & lex)
+{
+ read(lex);
+}
+
+
+void InsetInclude::read(LyXLex & lex)
{
params_.cparams.read(lex);
}
-string const InsetInclude::getScreenLabel(Buffer const *) const
+string const InsetInclude::getScreenLabel(Buffer const &) const
{
string temp;
}
-int InsetInclude::latex(Buffer const * buffer, ostream & os,
+int InsetInclude::latex(Buffer const & buffer, ostream & os,
LatexRunParams const & runparams) const
{
string incfile(params_.cparams.getContents());
Buffer * tmp = bufferlist.getBuffer(getFileName());
// FIXME: this should be a GUI warning
- if (tmp->params.textclass != buffer->params.textclass) {
+ if (tmp->params.textclass != buffer.params.textclass) {
lyxerr << "WARNING: Included file `"
<< MakeDisplayPath(getFileName())
<< "' has textclass `"
<< tmp->params.getLyXTextClass().name()
<< "' while parent file has textclass `"
- << buffer->params.getLyXTextClass().name()
+ << buffer.params.getLyXTextClass().name()
<< "'." << endl;
//return 0;
}
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".tex");
- if (!buffer->tmppath.empty() && !runparams.nice) {
+ if (!buffer.tmppath.empty() && !runparams.nice) {
incfile = subst(incfile, '/','@');
#ifdef __EMX__
incfile = subst(incfile, ':', '$');
#endif
- writefile = AddName(buffer->tmppath, incfile);
+ writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
writefile = ChangeExtension(writefile, ".tex");
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
- tmp->markDepClean(buffer->tmppath);
+ tmp->markDepClean(buffer.tmppath);
tmp->makeLaTeXFile(writefile, OnlyPath(getMasterFilename()),
runparams, false);
}
-int InsetInclude::ascii(Buffer const *, ostream & os, int) const
+int InsetInclude::ascii(Buffer const &, ostream & os, int) const
{
if (isVerbatim())
os << GetFileContents(getFileName());
}
-int InsetInclude::linuxdoc(Buffer const * buffer, ostream & os) const
+int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os) const
{
string incfile(params_.cparams.getContents());
// 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);
+ writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
- tmp->makeLinuxDocFile(writefile, buffer->niceFile, true);
+ tmp->makeLinuxDocFile(writefile, buffer.niceFile, true);
}
if (isVerbatim()) {
}
-int InsetInclude::docbook(Buffer const * buffer, ostream & os,
+int InsetInclude::docbook(Buffer const & buffer, ostream & os,
bool /*mixcont*/) const
{
string incfile(params_.cparams.getContents());
// 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);
+ writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
if (IsLyXFilename(getFileName()))
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
- tmp->makeDocBookFile(writefile, buffer->niceFile, true);
+ tmp->makeDocBookFile(writefile, buffer.niceFile, true);
}
if (isVerbatim()) {
string incfile(params_.cparams.getContents());
string writefile;
- Buffer const * const b = bufferlist.getBuffer(getMasterFilename());
+ Buffer const & b = *bufferlist.getBuffer(getMasterFilename());
- if (b && !b->tmppath.empty() && !b->niceFile && !isVerbatim()) {
+ if (!b.tmppath.empty() && !b.niceFile && !isVerbatim()) {
incfile = subst(incfile, '/','@');
- writefile = AddName(b->tmppath, incfile);
+ writefile = AddName(b.tmppath, incfile);
} else
writefile = getFileName();
// a file got loaded
Buffer * const tmp = bufferlist.getBuffer(getFileName());
if (tmp) {
- if (b)
- tmp->niceFile = b->niceFile;
+ tmp->niceFile = b.niceFile;
tmp->validate(features);
}
}
} else {
if (!set_label_) {
set_label_ = true;
- button_.update(getScreenLabel(mi.base.bv->buffer()),
+ button_.update(getScreenLabel(*mi.base.bv->buffer()),
editable() != NOT_EDITABLE);
}
button_.metrics(mi, dim);
ostringstream os;
LatexRunParams runparams;
runparams.flavor = LatexRunParams::LATEX;
- parent().latex(view()->buffer(), os, runparams);
+ parent().latex(*view()->buffer(), os, runparams);
return STRCONV(os.str());
}
if (lex.isOK()) {
InsetInclude inset(params);
- inset.read(0, lex);
+ inset.read(lex);
params = inset.params();
}
}
inset.set(params);
ostringstream data;
data << name_ << ' ';
- inset.write(0, data);
+ inset.write(data);
data << "\\end_inset\n";
return STRCONV(data.str());
}