make sure extensions are kept when necessary

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5870 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-12-19 10:07:35 +00:00
parent adbf4d7f68
commit d775e02fe1
2 changed files with 21 additions and 5 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -592,11 +592,16 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const
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.
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
@ -639,10 +644,14 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const
}
}
if (from == to)
if (from == to) {
// No conversion is needed. LaTeX can handle the
// graphic file as is.
if (formats.getFormat(to)->extension() == GetExtension(orig_file))
return RemoveExtension(temp_file);
else
return temp_file;
}
}
string const outfile_base = RemoveExtension(temp_file);