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())