]> git.lyx.org Git - lyx.git/blobdiff - src/exporter.C
hopefully fix tex2lyx linking.
[lyx.git] / src / exporter.C
index fa32fc1e5b8c185fd147e9c31be14a9efa887ebf..eff1172ae893d0100c3922928fae39103d2191ec 100644 (file)
@@ -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<ExportedFile> const files =