X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fexporter.C;h=eff1172ae893d0100c3922928fae39103d2191ec;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=fa32fc1e5b8c185fd147e9c31be14a9efa887ebf;hpb=fa1856440c9b323c4f1b5a9034264357c7087bb4;p=lyx.git diff --git a/src/exporter.C b/src/exporter.C index fa32fc1e5b..eff1172ae8 100644 --- a/src/exporter.C +++ b/src/exporter.C @@ -217,18 +217,20 @@ bool Exporter::Export(Buffer * buffer, string const & format, } string const error_type = (format == "program")? "Build" : bufferFormat(*buffer); - bool const success = converters.convert(buffer, filename, filename, - backend_format, format, result_file, + string const ext = formats.extension(format); + string const tmp_result_file = changeExtension(filename, ext); + bool const success = converters.convert(buffer, filename, + tmp_result_file, buffer->fileName(), backend_format, format, buffer->errorList(error_type)); // Emit the signal to show the error list. buffer->errors(error_type); if (!success) return false; - if (!put_in_tempdir) { - string const tmp_result_file = result_file; - result_file = changeExtension(buffer->fileName(), - formats.extension(format)); + if (put_in_tempdir) + result_file = tmp_result_file; + else { + result_file = changeExtension(buffer->fileName(), ext); // We need to copy referenced files (e. g. included graphics // if format == "dvi") to the result dir. vector const files =