X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ef5b1dad1f5d18309d0fdc0b36ad383b58f1a2e..6f026b5b63fe7ccb025e84509886f74772b9df13:/src/dfb/cursor.cpp?ds=inline diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp index 9d9bf2e850..96e25b4c2d 100644 --- a/src/dfb/cursor.cpp +++ b/src/dfb/cursor.cpp @@ -3,7 +3,6 @@ // Purpose: wxCursor implementation // Author: Vaclav Slavik // Created: 2006-08-08 -// RCS-ID: $Id$ // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -30,6 +29,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 +70,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*(wxCursorRefData *)data); + return static_cast(data)->Clone(); }