]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
no real change; just reorder functions
[wxWidgets.git] / src / common / variant.cpp
index 6d3996af8245bd40b323b8ab4ddeedc2e8fb8b73..2b952944b1401ce9ac5f26cbbbc48c0a60b2cede 100644 (file)
@@ -1034,7 +1034,7 @@ bool wxVariantDataWxObjectPtr::Write(wxSTD ostream& str) const
 
 bool wxVariantDataWxObjectPtr::Write(wxString& str) const
 {
-    str.Printf(wxT("%s(%p)"), GetType().c_str(), wx_static_cast(void*, m_value));
+    str.Printf(wxT("%s(%p)"), GetType().c_str(), static_cast<void*>(m_value));
     return true;
 }
 
@@ -1242,7 +1242,10 @@ bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
 
 bool wxVariantDataDateTime::Write(wxString& str) const
 {
-    str = m_value.Format();
+    if ( m_value.IsValid() )
+        str = m_value.Format();
+    else
+        str = wxS("Invalid");
     return true;
 }
 
@@ -1258,6 +1261,12 @@ bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
 
 bool wxVariantDataDateTime::Read(wxString& str)
 {
+    if ( str == wxS("Invalid") )
+    {
+        m_value = wxInvalidDateTime;
+        return true;
+    }
+
     if(! m_value.ParseDateTime(str.c_str()/*FIXME-UTF8*/))
         return false;
     return true;