X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a737331db68b754c8bf31fa0a15f6d1f207b40bf..3bcf00abd7aa6b515e776e18b3e295467a693959:/src/common/object.cpp 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())