]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bitmap.cpp
drawing the border based on the native control's border, as things like calctrl may...
[wxWidgets.git] / src / msw / bitmap.cpp
index 5fbb33b9639fe74cb7704e8839b782f8c9bb2459..a68457e219faac1be4fedd92ccc21e3033ad96f1 100644 (file)
@@ -264,7 +264,6 @@ wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const
         return NULL;
 
     wxBitmap *self = wx_const_cast(wxBitmap *, this);
-    self->m_refData = new wxBitmapRefData(*data);
 
 #if wxUSE_WXDIB
     // copy the other bitmap
@@ -273,7 +272,12 @@ wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const
         wxDIB dib((HBITMAP)(data->m_hBitmap));
         self->CopyFromDIB(dib);
     }
+    else
 #endif // wxUSE_WXDIB
+    {
+        // don't copy the bitmap data, but do copy the size, depth, ...
+        self->m_refData = new wxBitmapRefData(*data);
+    }
 
     return m_refData;
 }