From 5e47fc73d5e6d1205b186a78da6261ad3c4bae4d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 22 Jan 2012 14:08:53 +0000 Subject: [PATCH] Enable the graphics converter to copy with identical in and out file names. This is already supported in Converters::convert() and needed e.g. for eps2->eps conversion. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40649 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/GraphicsConverter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/graphics/GraphicsConverter.cpp b/src/graphics/GraphicsConverter.cpp index e3386f13ea..ccfb57ce4b 100644 --- a/src/graphics/GraphicsConverter.cpp +++ b/src/graphics/GraphicsConverter.cpp @@ -356,6 +356,12 @@ static void build_script(string const & from_file, subst(conv.result_file, token_base, onlyFileName(infile_base))); + // If two formats share the same extension we may get identical names + if (outfile == infile && conv.result_file.empty()) { + string const new_base = FileName::tempName(tmp).toFilesystemEncoding(); + outfile = addExtension(new_base, conv.To->extension()); + } + // Store these names in the python script script << "infile = " << quoteName(infile, quote_python) << "\n" -- 2.39.2