X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9cb9fdb372467eed8d214e892ac99bb1854c5f25..d21d2e5adf7a5acf3b496a9c4e87eab220bd75d8:/src/msw/gdiimage.cpp diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 64ad5b730c..3ead2479d1 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -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;