X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d84afea9d1ec41ee4e2ebb3bf6b87926cf5f04d1..6eccc0c485e57fe27fc56673f4f4dd191a09b2e6:/src/common/variant.cpp diff --git a/src/common/variant.cpp b/src/common/variant.cpp index abbd2de6e5..48d54c7ec1 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -2054,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) { @@ -2238,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)); }