Implement proper wxCursor cloning in wxDFB.
wxDFB compilation was broken by recent wxObjectRefData copy ctor-related changes. Fix it by not using wxCursorRefData copy ctor any more, call wxCursorRefData::Clone() which does the right thing explicitly instead. Closes #12791. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -30,6 +30,15 @@ public:
|
||||
|
||||
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;
|
||||
};
|
||||
@@ -62,7 +71,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const
|
||||
|
||||
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
|
||||
{
|
||||
return new wxCursorRefData(*(wxCursorRefData *)data);
|
||||
return static_cast<const wxCursorRefData *>(data)->Clone();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user