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
This commit is contained in:
Baruch Even 2001-07-23 16:07:29 +00:00
parent 86ea4e48e7
commit 0901dfd71f
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-07-23 Baruch Even <baruch@lyx.org>
* GraphicsCacheItem.C (convertImage): Fixed a bug with regard to loading
the image after conversion.
2001-07-17 Baruch Even <baruch@lyx.org>
* GraphicsCacheItem.h:

View File

@ -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);