X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a737331db68b754c8bf31fa0a15f6d1f207b40bf..5b4f8dd5c0fe1bf44fb7971c669b036d4ad6eebe:/src/common/object.cpp?ds=inline diff --git a/src/common/object.cpp b/src/common/object.cpp index 5b65936689..3e3a612d48 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -89,10 +89,17 @@ bool wxObject::IsKindOf(wxClassInfo *info) const wxObject *wxObject::Clone() const { - return GetClassInfo()->CreateObject(); + wxObject *object = GetClassInfo()->CreateObject(); + CopyObject(*object); + return object; } -#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT +void wxObject::CopyObject(wxObject& object_dest) const +{ + wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo())); +} + +#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) void wxObject::Dump(ostream& str) { if (GetClassInfo() && GetClassInfo()->GetClassName())