* ======================================================
*
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
using std::endl;
-InsetExternal::InsetExternal()
+InsetExternal::InsetExternal()
: view_(0)
{
tempname_ = lyx::tempName(string(), "lyxext");
{
return params_;
}
-
-
+
+
void InsetExternal::setFromParams(Params const & p)
{
params_.filename = p.filename;
params_.parameters = p.parameters;
params_.templ = p.templ;
-}
+}
string const InsetExternal::editMessage() const
} else {
lex.printError("InsetExternal: Parse error: `$$Token'");
}
-
+
while (lex.isOK()) {
lex.nextToken();
token = lex.getString();
<< params_.templ.lyxName << endl;
return 0;
}
-
+
updateExternal(format, buf);
os << doSubstitution(buf, cit->second.product);
return 0; // CHECK (FIXME check what ? - jbl)
if (cit == et.formats.end())
return;
-
+
if (!cit->second.requirement.empty()) {
features.require(cit->second.requirement);
}
string result;
string const basename = ChangeExtension(params_.filename, string());
string filepath;
- if (buffer && (!buffer->niceFile)) {
+ if (buffer && !buffer->tmppath.empty() && !buffer->niceFile) {
filepath = buffer->filePath();
}
result = subst(s, "$$FName", params_.filename);
result = ReplaceEnvironmentPath(result);
result = subst(result, "$$Tempname", tempname_);
result = subst(result, "$$Sysdir", system_lyxdir);
-
+
// Handle the $$Contents(filename) syntax
if (contains(result, "$$Contents(\"")) {
void InsetExternal::updateExternal() const
{
- updateExternal("LaTeX", view_->buffer());
+ updateExternal("LaTeX", view_->buffer());
}
void InsetExternal::updateExternal(string const & format,
cit->second.updateCommand.empty() ||
!et.automaticProduction)
return;
-
+
if (!cit->second.updateResult.empty()) {
string const resultfile = doSubstitution(buf,
cit->second.updateResult);
if (fi2.exist() && fi.exist() &&
::difftime(fi2.getModificationTime(),
fi.getModificationTime()) >= 0) {
- lyxerr[Debug::FILES] << resultfile
+ lyxerr[Debug::FILES] << resultfile
<< " is up to date" << endl;
return;
}
bool operator!=(InsetExternal::Params const & left,
InsetExternal::Params const & right)
{
- return !(left == right);
+ return !(left == right);
}
-