From fd324b295445fb9ed2d7ced81a3a209fe8cec6ce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 22 Dec 2010 13:57:15 +0000 Subject: [PATCH] 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 --- src/dfb/cursor.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp index 9d9bf2e850..e013a91295 100644 --- a/src/dfb/cursor.cpp +++ b/src/dfb/cursor.cpp @@ -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(data)->Clone(); } -- 2.45.2