]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
fixed bug in parsing formats in which fields don't have any non-numeric delimiters
[wxWidgets.git] / src / common / variant.cpp
index abbd2de6e5b0dc7876cd4fdb5592dd9c442999e3..48d54c7ec1841cdf6b57e586e678fabeef37a726 100644 (file)
@@ -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));
 }