From d775e02fe119ac611c5788171adf03a23774a362 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 19 Dec 2002 10:07:35 +0000 Subject: [PATCH] make sure extensions are kept when necessary git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5870 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 7 +++++++ src/insets/insetgraphics.C | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 9632c5c166..bba54dfa72 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ +2002-12-18 Jean-Marc Lasgouttes + + * 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 * insettext.C (lfunMouseRelease): hackish solution to the "double diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 79bb4f0a93..5fb9e60572 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -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. - 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 @@ -639,12 +644,16 @@ 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. - 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" -- 2.39.2