]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/bitmap.cpp
Add some more docs to the runtime installer.
[wxWidgets.git] / src / mac / carbon / bitmap.cpp
index 3a2d1991b775763583a2dcb3cc5a7f3063ce031e..4339cf4b57c3d2c304d8786a25a1c4525643efaa 100644 (file)
@@ -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 ;