]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/bitmap.cpp
make sure we are feeding coordinates of HIView instances, not wx-dimensions back...
[wxWidgets.git] / src / mac / carbon / bitmap.cpp
index d7f9c3ba838af7b508e368c5ceb894aebf822c65..4b2a1526b4aa3b4a7c4ab56bfa354e1f6dfee6d4 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/dcmemory.h"
+    #include "wx/icon.h"
+    #include "wx/image.h"
 #endif
 
-#include "wx/icon.h"
-#include "wx/image.h"
 #include "wx/metafile.h"
 #include "wx/xpmdecod.h"
 
@@ -35,7 +36,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
 #endif
 
 #include "wx/mac/uma.h"
-#include "wx/dcmemory.h"
 
 // Implementation Notes
 // --------------------
@@ -165,8 +165,8 @@ wxBitmapRefData::wxBitmapRefData( int w , int h , int d )
 
 bool wxBitmapRefData::Create( int w , int h , int d )
 {
-    m_width = w ;
-    m_height = ;
+    m_width = wxMax(1, w);
+    m_height = wxMax(1, h);
     m_depth = d ;
 
     m_bytesPerRow = w * 4 ;
@@ -397,7 +397,7 @@ IconRef wxBitmapRefData::GetIconRef()
             SetIconFamilyData( iconFamily, 'PICT' , (Handle) pic ) ;
         }
         // transform into IconRef
-#ifdef __WXMAC_OSX__
+#if defined( __WXMAC_OSX__ ) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
         // cleaner version existing from 10.3 upwards
         HLock((Handle) iconFamily);
         OSStatus err = GetIconRefFromIconFamilyPtr( *iconFamily, GetHandleSize((Handle) iconFamily), &m_iconRef );