X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d45318b8b6857ab6159b37c2f3ddce6a5f68be28..e015e7f3acef09b57bcd34e8f6780a19afdfd97b:/src/mac/carbon/bitmap.cpp diff --git a/src/mac/carbon/bitmap.cpp b/src/mac/carbon/bitmap.cpp index 3a2d1991b7..4339cf4b57 100644 --- a/src/mac/carbon/bitmap.cpp +++ b/src/mac/carbon/bitmap.cpp @@ -108,6 +108,10 @@ void wxMacReleaseBitmapButton( ControlButtonContentInfo*info ) { ReleaseIconRef( info->u.iconRef ) ; } + else if ( info->contentType == kControlNoContent ) + { + // there's no bitmap at all, fall through silently + } else if ( info->contentType == kControlContentPictHandle ) { // owned by the bitmap, no release here @@ -363,9 +367,6 @@ IconRef wxBitmapRefData::GetIconRef() } else { - iconFamily = (IconFamilyHandle) NewHandle(8) ; - (**iconFamily).resourceType = kIconFamilyType ; - (**iconFamily).resourceSize = sizeof(OSType) + sizeof(Size); PicHandle pic = GetPictHandle() ; SetIconFamilyData( iconFamily, 'PICT' , (Handle) pic ) ; } @@ -705,6 +706,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) EndRawAccess() ; DisposeHandle( imagehandle ) ; DisposeHandle( maskhandle ) ; + created = true ; } DisposeHandle( (Handle) iconFamily ) ; @@ -1075,15 +1077,12 @@ wxImage wxBitmap::ConvertToImage() const { if ( *maskp++ == 0 ) { - if ( r == MASK_RED && g == MASK_GREEN && b == MASK_BLUE ) - b = MASK_BLUE_REPLACEMENT ; - else - { - r = MASK_RED ; - g = MASK_GREEN ; - b = MASK_BLUE ; - } + r = MASK_RED ; + g = MASK_GREEN ; + b = MASK_BLUE ; } + else if ( r == MASK_RED && g == MASK_GREEN && b == MASK_BLUE ) + b = MASK_BLUE_REPLACEMENT ; } else if ( hasAlpha ) *alpha++ = a ;