X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalSupport.cpp;h=aa6f51cbe919a1222a6157df140ee3dec00af6cd;hb=6b49b6b129af9417fea7ea907a44a46fbbd38340;hp=5b830a697be560b81e7878fc80c4f9e171d9af95;hpb=62ca7f3ae55ad2e0c395cb554d71afab87de1ee3;p=lyx.git diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index 5b830a697b..aa6f51cbe9 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -88,10 +88,10 @@ string const doSubstitution(InsetExternalParams const & params, masterBuffer->temppath() : buffer.filePath(); string const filename = external_in_tmpdir ? - params.filename.mangledFilename() : - params.filename.outputFilename(parentpath); + params.filename.mangledFileName() : + params.filename.outputFileName(parentpath); string const basename = changeExtension( - onlyFilename(filename), string()); + onlyFileName(filename), string()); string const absname = makeAbsPath(filename, parentpath).absFileName(); string result = s; @@ -246,7 +246,7 @@ void updateExternal(InsetExternalParams const & params, // We copy the source file to the temp dir and do the conversion // there if necessary FileName const temp_file( - makeAbsPath(params.filename.mangledFilename(), + makeAbsPath(params.filename.mangledFileName(), masterBuffer->temppath())); if (!params.filename.empty() && !params.filename.isDirectory()) { unsigned long const from_checksum = params.filename.checksum(); @@ -361,13 +361,22 @@ int writeExternal(InsetExternalParams const & params, use_latex_path, external_in_tmpdir); 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)); + params.filename.outputFileName(buffer.filePath()), buffer.filePath()).absFileName(); + + 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);