X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb42d7c3b4aa088a51fabf71203e8c5ee784d734..d1efca1a2ac2dd20d47d217ce2be1bcc506377e0:/src/common/variant.cpp diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 6449a5fdd4..48d54c7ec1 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1390,6 +1390,7 @@ wxVariant::wxVariant(const wxArrayString& val, const wxString& name) // Strings } wxVariant::wxVariant(const wxVariant& variant) + : wxObject() { if (!variant.IsNull()) { @@ -1436,8 +1437,10 @@ void wxVariant::operator= (const wxVariant& variant) delete m_data; m_data = (wxVariantData*) variant.GetData()->GetClassInfo()->CreateObject(); } -// GetData()->Copy(* variant.GetData()); + variant.GetData()->Copy(* GetData()); + + m_name = variant.m_name; } // Assignment using data, e.g. @@ -1810,7 +1813,7 @@ void wxVariant::operator= (const TIMESTAMP_STRUCT* value) #endif // wxUSE_ODBC -bool wxVariant::operator==(const wxArrayString& value) const +bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const { wxFAIL_MSG( _T("TODO") ); @@ -2051,6 +2054,12 @@ wxStringList& wxVariant::GetStringList() const return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue(); } +// Make empty list +void wxVariant::NullList() +{ + SetData(new wxVariantDataList()); +}; + // Append to list void wxVariant::Append(const wxVariant& value) { @@ -2235,9 +2244,11 @@ bool wxVariant::Convert(wxDateTime* value) const { wxString type(GetType()); if (type == wxT("datetime")) + { *value = ((wxVariantDataDateTime*)GetData())->GetValue(); - else - return FALSE; - - return TRUE; + return TRUE; + } + // Fallback to string conversion + wxString val; + return Convert(&val) && (value->ParseDate(val)); }