} // namespace anon
-int writeExternal(InsetExternalParams const & params,
- string const & format,
- Buffer const & buffer, odocstream & os,
- ExportData & exportdata,
- bool external_in_tmpdir,
- bool dryrun)
+void writeExternal(InsetExternalParams const & params,
+ string const & format,
+ Buffer const & buffer, otexstream & os,
+ ExportData & exportdata,
+ bool external_in_tmpdir,
+ bool dryrun)
{
Template const * const et_ptr = getTemplatePtr(params);
if (!et_ptr)
- return 0;
+ return;
Template const & et = *et_ptr;
Template::Formats::const_iterator cit = et.formats.find(format);
if (cit == et.formats.end()) {
LYXERR(Debug::EXTERNAL, "External template format '" << format
<< "' not specified in template " << params.templatename());
- return 0;
+ return;
}
if (!dryrun || contains(cit->second.product, "$$Contents"))
string const absname = makeAbsPath(
params.filename.outputFileName(buffer.filePath()), buffer.filePath()).absFileName();
- if (!external_in_tmpdir && !isValidLaTeXFileName(absname)) {
- lyx::frontend::Alert::warning(_("Invalid filename"),
- _("The following filename is likely to cause trouble "
- "when running the exported file through LaTeX: ") +
- from_utf8(absname));
+ if (!dryrun && !external_in_tmpdir) {
+ if (!isValidLaTeXFileName(absname)) {
+ lyx::frontend::Alert::warning(_("Invalid filename"),
+ _("The following filename will cause troubles "
+ "when running the exported file through LaTeX: ") +
+ from_utf8(absname));
+ }
+ if (!isValidDVIFileName(absname)) {
+ lyx::frontend::Alert::warning(_("Problematic filename for DVI"),
+ _("The following filename can cause troubles "
+ "when running the exported file through LaTeX "
+ "and opening the resulting DVI: ") +
+ from_utf8(absname), true);
+ }
}
str = substituteCommands(params, str, format);
str = substituteOptions(params, str, format);
// FIXME UNICODE
os << from_utf8(str);
- return int(count(str.begin(), str.end(),'\n'));
+ return;
}
namespace {