]> git.lyx.org Git - lyx.git/blobdiff - src/importer.C
Updates from Bennett and myself.
[lyx.git] / src / importer.C
index d00b05c4c8295504266ef29c42bad545ce70e9a6..457024f2a8f7ed4356ac401eb0fedb6964061df8 100644 (file)
@@ -32,6 +32,7 @@ namespace lyx {
 
 using support::bformat;
 using support::changeExtension;
+using support::FileName;
 using support::makeDisplayPath;
 
 using std::find;
@@ -53,8 +54,11 @@ bool Importer::Import(LyXView * lv, string const & filename,
                for (vector<string>::const_iterator it = loaders.begin();
                     it != loaders.end(); ++it) {
                        if (converters.isReachable(format, *it)) {
-                               if (!converters.convert(0, filename, filename,
-                                                       format, *it, errorList))
+                               string const tofile =
+                                       changeExtension(filename,
+                                               formats.extension(*it));
+                               if (!converters.convert(0, FileName(filename), FileName(tofile),
+                                                       FileName(filename), format, *it, errorList))
                                        return false;
                                loader_format = *it;
                                break;