From 0901dfd71fa56cea9dfdff48056082946c0fde3b Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Mon, 23 Jul 2001 16:07:29 +0000 Subject: [PATCH] Fixed a bug created in the code reordering. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2311 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 5 +++++ src/graphics/GraphicsCacheItem.C | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 67edad92ce..9eedb41159 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2001-07-23 Baruch Even + + * GraphicsCacheItem.C (convertImage): Fixed a bug with regard to loading + the image after conversion. + 2001-07-17 Baruch Even * GraphicsCacheItem.h: diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index c145e8cb34..a5aa650fd7 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -97,7 +97,7 @@ string const findTargetFormat(string const & from) typedef ImageLoader::FormatList FormatList; FormatList formats = ImageLoaderXPM().loadableFormats(); lyx::Assert(formats.size() > 0); // There must be a format to load from. - + FormatList::const_iterator iter = formats.begin(); FormatList::const_iterator end = formats.end(); @@ -105,6 +105,7 @@ string const findTargetFormat(string const & from) if (converters.IsReachable(from, *iter)) break; } + if (iter == end) { // We do not know how to convert the image to something loadable. lyxerr << "ERROR: Do not know how to convert image." << std::endl; @@ -143,10 +144,11 @@ GraphicsCacheItem::convertImage(string const & filename) // Remove the temp file, we only want the name... lyx::unlink(tempfile); - converters.Convert(0, filename, tempfile, from, to); - + bool result = converters.Convert(0, filename, tempfile, from, to); + tempfile.append(".xpm"); + // For now we are synchronous - imageConverted(true); + imageConverted(result); // Cleanup after the conversion. lyx::unlink(tempfile); -- 2.39.2