From 3c22b7dc3b576e187266f26041ba70ce439a7789 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 22 Jul 2002 20:50:45 +0000 Subject: [PATCH] =?utf8?q?2002-07-22=20=20Lars=20Gullik=20Bj=EF=BF=BDnnes?= =?utf8?q?=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * GraphicsConverter.C (build_script): take a ostream as a more general argument than ostringstream. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4750 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 17 +++++++++++------ src/graphics/GraphicsConverter.C | 21 ++++++++++++--------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 70ad150205..b6ef29dc1a 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,7 +1,12 @@ +2002-07-22 Lars Gullik Bjønnes + + * GraphicsConverter.C (build_script): take a ostream as a more + general argument than ostringstream. + 2002-07-22 Herbert Voss * GraphicsConverter.C: get the "default converter" run again - + 2002-07-21 Jean-Marc Lasgouttes * PreviewLoader.C: use BufferParams::getLyXTextClass @@ -27,7 +32,7 @@ 2002-07-18 Jean-Marc Lasgouttes * GraphicsCacheItem.C (reset): use erase() instead of clear() for - strings + strings 2002-07-18 Angus Leeming @@ -66,7 +71,7 @@ * GraphicsConverter.[Ch]: (startConversion): const-ify. (finishedConversion): move the signal into the Impl class. (connect): new method, enabling a listener to connect to this signal. - + * GraphicsLoader.[Ch] (reset, startLoading): const-ify. (statusChanged): move the signal into the Impl class. (connect): new method, enabling a listener to connect to this signal. @@ -107,11 +112,11 @@ * Previews.[Ch]: use const in more places. (generateBufferPreviews): now takes a Buffer const & argument, not a pointer. - + 2002-07-15 John Levon * GraphicsImage.h: remove getPixmap/X, add isDrawable() - + 2002-07-12 Angus Leeming * GraphicsLoader.[Ch]: smart loading of images. Images are loaded only @@ -130,7 +135,7 @@ 2002-07-12 John Levon * GraphicsCache.C: remove init_graphics() - + 2002-07-09 Angus Leeming * PreviewLoader.C (setAscentFractions): fix bug due to use of integer diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index 4b689bdde1..548a524fd1 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -25,10 +25,12 @@ #include #include "Lsstream.h" +#include "support/LOstream.h" #include #include // needed for pid_t using std::endl; +using std::ostream; namespace grfx { @@ -114,7 +116,7 @@ namespace { */ bool build_script(string const & from_file, string const & to_file_base, string const & from_format, string const & to_format, - ostringstream & script); + ostream & script); } // namespace anon @@ -140,21 +142,21 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, // The converted image is to be stored in this file to_file_ = ChangeExtension(to_file_base, formats.extension(to_format)); - if (!success) { + if (!success) { script_file_ = string(); if (from_format == "lyxpreview") { - script_command_ = - LibFileSearch("scripts", "lyxpreview2xpm.sh") + script_command_ = + LibFileSearch("scripts", "lyxpreview2xpm.sh") + " " +from_file + " " + to_file_; - lyxerr[Debug::GRAPHICS] + lyxerr[Debug::GRAPHICS] << "\tI use lyxpreview2xpm for the conversion\n\t" << script_command_ << endl; - } else { - script_command_ = + } else { + script_command_ = LibFileSearch("scripts", "convertDefault.sh") + ' ' + from_format + ':' + from_file + ' ' + to_format + ':' + to_file_; - lyxerr[Debug::GRAPHICS] + lyxerr[Debug::GRAPHICS] << "\tNo converter defined! I use convertDefault.sh\n\t" << script_command_ << endl; } @@ -256,11 +258,12 @@ string const move_file(string const & from_file, string const & to_file) return command.str().c_str(); } + bool build_script(string const & from_file, string const & to_file_base, string const & from_format, string const & to_format, - ostringstream & script) + ostream & script) { lyxerr[Debug::GRAPHICS] << "build_script ... "; typedef Converters::EdgePath EdgePath; -- 2.39.2