From 67903edc17b7a24feccd34f57aec1aa3e51ba01a Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Sun, 29 Jul 2001 07:29:09 +0000 Subject: [PATCH] Compilation fix (I broke, I fixed). Color allocation fix, made it allocate close colors too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2380 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 7 +++++++ src/graphics/GraphicsCacheItem.C | 6 +++++- src/graphics/ImageLoaderXPM.C | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 896630c7fb..df3e9e075f 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,10 @@ +2001-07-29 Baruch Even + + * ImageLoaderXPM.C (runImageLoader): When loading agree to use non-exact + colors with closeness of 10000. + + * GraphicsCacheItem.C: Fixed a compilation bug introduced earlier. + 2001-07-29 Baruch Even * GraphicsCacheItem.C (findTargetFormat): Removed error dialog box, diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index 298f8020b4..0def93c5a6 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -76,7 +76,11 @@ GraphicsCacheItem::getImage() const { return image_.get(); } void GraphicsCacheItem::imageConverted(bool success) { - lyxerr << "imageConverted, status=" << success << endl; + // Debug output + string text = "succeeded"; + if (!success) + text = "failed"; + lyxerr << "imageConverted, conversion " << text << "." << endl; if (! success) { lyxerr << "(GraphicsCacheItem::imageConverter) " diff --git a/src/graphics/ImageLoaderXPM.C b/src/graphics/ImageLoaderXPM.C index b92a0bb011..5603203f66 100644 --- a/src/graphics/ImageLoaderXPM.C +++ b/src/graphics/ImageLoaderXPM.C @@ -69,7 +69,9 @@ ImageLoaderXPM::runImageLoader(string const & filename) Pixmap pixmap; Pixmap mask; XpmAttributes attrib; - attrib.valuemask = 0; + + attrib.valuemask = XpmCloseness | XpmAllocColor; + attrib.closeness = 10000; int status = XpmReadFileToPixmap( display, @@ -79,7 +81,7 @@ ImageLoaderXPM::runImageLoader(string const & filename) if (status != XpmSuccess) { lyxerr << "Error reading XPM file '" - << XpmGetErrorString(status) + << XpmGetErrorString(status) << "'" << endl; return ErrorWhileLoading; } -- 2.39.2