blind fix for wxMotif compilation with wxHAVE_LIB_XPM == 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-04-25 11:10:45 +00:00
parent c5a2f27478
commit 0cad49b42c

View File

@@ -1357,12 +1357,9 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
if (stream.Ok())
{
wxImage image(decoder.ReadFile(stream));
if (image.Ok())
return CreateFromImage(image);
else
return FALSE;
return image.Ok() && bitmap->CreateFromImage(image);
}
else
#else // !wxHAVE_LIB_XPM && !wxUSE_STREAMS
return FALSE;
#endif // wxHAVE_LIB_XPM / wxUSE_STREAMS
}
@@ -1471,14 +1468,11 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *bits,
return FALSE;
}
#else
#else // !wxHAVE_LIB_XPM
wxXPMDecoder decoder;
wxImage image(decoder.ReadData(bits));
if (image.Ok())
return bitmap->CreateFromImage(image);
else
return FALSE;
#endif
wxImage image(decoder.ReadData((const char **)bits));
return image.Ok() && bitmap->CreateFromImage(image);
#endif // wxHAVE_LIB_XPM/!wxHAVE_LIB_XPM
}
#endif // wxUSE_XPM