X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd21c82639bd7158fffdae4bf33280af8a767459..198be845897a79ba350ae7f93db536ddb2eccfb2:/src/x11/bitmap.cpp diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 3abc8df228..ba6ebacd0e 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -593,10 +593,11 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) M_BMPDATA->m_pixmap = XCreatePixmap( xdisplay, xroot, width, height, depth ); - // Create mask + // Create mask if necessary + const bool hasMask = image.HasMask(); XImage *mask_image = (XImage*) NULL; - if (image.HasMask()) + if ( hasMask ) { mask_image = XCreateImage( xdisplay, xvisual, 1, ZPixmap, 0, 0, width, height, 32, 0 ); mask_image->data = (char*) malloc( mask_image->bytes_per_line * mask_image->height ); @@ -646,8 +647,6 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) unsigned char *colorCube = wxTheApp->GetVisualInfo(M_BMPDATA->m_display)->m_colorCube; - bool hasMask = image.HasMask(); - int index = 0; for (int y = 0; y < height; y++) { @@ -1360,7 +1359,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, Pixmap mask = 0; int ErrorStatus = XpmReadFileToPixmap( xdisplay, xroot, - (char*) name.c_str(), + (char*) ((const char*) name.c_str()), &pixmap, &mask, &xpmAttr); if (ErrorStatus == XpmSuccess) @@ -1372,7 +1371,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, XpmFreeAttributes(&xpmAttr); - M_BMPHANDLERDATA->m_bitmap = (WXPixmap) pixmap; + M_BMPHANDLERDATA->m_bitmap = (Pixmap) pixmap; if (mask) { @@ -1497,7 +1496,7 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits, XpmFreeAttributes(&xpmAttr); - M_BMPHANDLERDATA->m_pixmap = (WXPixmap) pixmap; + M_BMPHANDLERDATA->m_pixmap = (Pixmap) pixmap; if (mask) {