]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
Hopefully corrected conversion buffer size.
[wxWidgets.git] / src / common / variant.cpp
index 894c1cf9aa3f5171806753a6ba133bb690b2177f..48d54c7ec1841cdf6b57e586e678fabeef37a726 100644 (file)
@@ -1390,6 +1390,7 @@ wxVariant::wxVariant(const wxArrayString& val, const wxString& name) // Strings
 }
 
 wxVariant::wxVariant(const wxVariant& variant)
+    : wxObject()
 {
     if (!variant.IsNull())
     {
@@ -2053,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)
 {
@@ -2237,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));
 }