X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..5b6ec9803a058368a1b240a22d444c7301c5715a:/src/msw/dib.cpp?ds=sidebyside diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 58d92874cb..4694f6b261 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -26,7 +26,6 @@ *******************************************************************************/ // For compilers that support precompilation, includes "wx.h". -#define IN_WX_MAIN_CPP #include "wx/wxprec.h" #if defined(__BORLANDC__) @@ -474,7 +473,8 @@ BOOL ReadDIB(LPSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette) goto ErrExit; } - if (!(nNumColors = (WORD)lpbi->biClrUsed)) + nNumColors = (WORD)lpbi->biClrUsed; + if ( nNumColors == 0 ) { /* no color table for 24-bit, default size otherwise */ if (lpbi->biBitCount != 24) @@ -595,7 +595,8 @@ BOOL PASCAL MakeBitmapAndPalette(HDC hDC, HANDLE hDIB, lpInfo = (LPBITMAPINFOHEADER) GlobalLock(hDIB); #endif - if ((hPalette = MakeDIBPalette(lpInfo))) + hPalette = MakeDIBPalette(lpInfo); + if ( hPalette ) { // Need to realize palette for converting DIB to bitmap. hOldPal = SelectPalette(hDC, hPalette, TRUE); @@ -682,7 +683,7 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo) ** some good color choices. */ else - return(GetStockObject(DEFAULT_PALETTE)); + return((HPALETTE) GetStockObject(DEFAULT_PALETTE)); } bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal)