added wxUSE_PALETTE and fixed compilation with it set to 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-09-30 22:06:39 +00:00
parent f1c1831fc5
commit d275c7eb84
21 changed files with 227 additions and 101 deletions

View File

@@ -355,6 +355,8 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap,
#if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *palette = NULL;
bool success = wxLoadIntoBitmap(WXSTRINGCAST name, bitmap, &palette) != 0;
#if wxUSE_PALETTE
if ( success && palette )
{
bitmap->SetPalette(*palette);
@@ -362,6 +364,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap,
// it was copied by the bitmap if it was loaded successfully
delete palette;
#endif // wxUSE_PALETTE
return success;
#else
@@ -375,9 +378,15 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap,
const wxPalette *pal)
{
#if wxUSE_IMAGE_LOADING_IN_MSW
#if wxUSE_PALETTE
wxPalette *actualPalette = (wxPalette *)pal;
if ( !actualPalette )
actualPalette = bitmap->GetPalette();
#else
wxPalette *actualPalette = NULL;
#endif // wxUSE_PALETTE
return wxSaveBitmap(WXSTRINGCAST name, bitmap, actualPalette) != 0;
#else
return FALSE;