+2002-12-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * insetgraphics.C (prepareFile): do not remove the extension of
+ the file name if it is not the default extension for the given
+ format (that is, in latex output, remove extension from foo.eps,
+ but not from foo.epsi)
+
2002-12-17 Alfredo Braunstein <abraunst@libero.it>
* insettext.C (lfunMouseRelease): hackish solution to the "double
lyxerr[Debug::GRAPHICS]
<< "\t we have: from " << from << " to " << to << '\n';
- if (from == to && !lyxrc.use_tempdir)
+ if (from == to && !lyxrc.use_tempdir) {
// No conversion is needed. LaTeX can handle the
// graphic file as is.
// This is true even if the orig_file is compressed.
- return RemoveExtension(orig_file_with_path);
+ if (formats.getFormat(to)->extension() == GetExtension(orig_file)) {
+ return RemoveExtension(orig_file_with_path);
+ } else {
+ return orig_file_with_path;
+ }
+ }
// We're going to be running the exported buffer through the LaTeX
// compiler, so must ensure that LaTeX can cope with the graphics
}
}
- if (from == to)
+ if (from == to) {
// No conversion is needed. LaTeX can handle the
// graphic file as is.
- return RemoveExtension(temp_file);
+ if (formats.getFormat(to)->extension() == GetExtension(orig_file))
+ return RemoveExtension(temp_file);
+ else
+ return temp_file;
+ }
}
-
+
string const outfile_base = RemoveExtension(temp_file);
lyxerr[Debug::GRAPHICS]
<< "\tThe original file is " << orig_file << "\n"