virtual bool IsOk() const { return m_bitmap.IsOk(); }
+ // Create a deep copy of this object.
+ wxCursorRefData *Clone() const
+ {
+ wxBitmap bitmapCopy(m_bitmap);
+ bitmapCopy.UnShare();
+
+ return new wxCursorRefData(bitmapCopy, m_id);
+ }
+
int m_id;
wxBitmap m_bitmap;
};
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*(wxCursorRefData *)data);
+ return static_cast<const wxCursorRefData *>(data)->Clone();
}