X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57c208c5759da71a637f0f0f5b7d3dc3eda09c02..a8f2578758be3956d1cb55503c8cb773c7c96322:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 948d339184..581eadde0a 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -142,7 +142,7 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits } // Create from XPM data -wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem)) +wxBitmap::wxBitmap(char **data, wxControl *WXUNUSED(anItem)) { (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); } @@ -620,13 +620,18 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ::LoadBitmap(wxGetInstance(), name); if (M_BITMAPHANDLERDATA->m_hBitmap) { - M_BITMAPHANDLERDATA->m_ok = TRUE; - BITMAP bm; - GetObject((HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap, sizeof(BITMAP), (LPSTR) &bm); - M_BITMAPHANDLERDATA->m_width = bm.bmWidth; - M_BITMAPHANDLERDATA->m_height = bm.bmHeight; - M_BITMAPHANDLERDATA->m_depth = bm.bmBitsPixel; - return TRUE; + M_BITMAPHANDLERDATA->m_ok = TRUE; + BITMAP bm; + GetObject((HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap, sizeof(BITMAP), (LPSTR) &bm); + M_BITMAPHANDLERDATA->m_width = bm.bmWidth; + M_BITMAPHANDLERDATA->m_height = bm.bmHeight; + M_BITMAPHANDLERDATA->m_depth = bm.bmBitsPixel; + + if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) ) + { + } + + return TRUE; } // it's probably not found @@ -670,7 +675,10 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXU palette = NULL; } if (palette) - M_BITMAPHANDLERDATA->m_bitmapPalette = *palette; + { + M_BITMAPHANDLERDATA->m_bitmapPalette = *palette; + delete palette; + } return success; #else return FALSE;