]> git.saurik.com Git - wxWidgets.git/commitdiff
adapting to bitmaprefdata changes
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 21 Feb 2005 13:53:22 +0000 (13:53 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 21 Feb 2005 13:53:22 +0000 (13:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dataobj.cpp
src/mac/carbon/icon.cpp

index ae340be2c558e6d6293975db3cad080fa4a9bc23..65401b5f33931e1ba76073fe81b588886540ec25 100644 (file)
@@ -254,8 +254,8 @@ wxBitmapDataObject::wxBitmapDataObject(
     Init();
     if ( m_bitmap.Ok() )
     {
-        m_pictHandle = wxMacCreatePicHandle( rBitmap ) ;
-        m_pictCreated = true ;
+        m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ;
+        m_pictCreated = false ;
     }
 }
 
@@ -272,8 +272,8 @@ void wxBitmapDataObject::SetBitmap(
     wxBitmapDataObjectBase::SetBitmap(rBitmap);
     if ( m_bitmap.Ok() )
     {
-        m_pictHandle = wxMacCreatePicHandle( rBitmap ) ;
-        m_pictCreated = true ;
+        m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ;
+        m_pictCreated = false ;
     }
 }
 
index 27cc3149d219eea3446930935f021dd99e32f747..2317c911e58f29dda7934f37e9b2aaec853ab780 100644 (file)
@@ -192,7 +192,10 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
 {
     UnRef() ;
     
-    m_refData = new wxIconRefData( (WXHICON) wxMacCreateIconRef( bmp ) ) ;
+    // as the bitmap owns that ref, we have to acquire it as well
+    IconRef iconRef = bmp.GetBitmapData()->GetIconRef() ;
+    AcquireIconRef( iconRef ) ;
+    m_refData = new wxIconRefData( (WXHICON) iconRef ) ;
     M_ICONDATA->SetWidth( bmp.GetWidth() ) ;
     M_ICONDATA->SetHeight( bmp.GetHeight() ) ;
 }