]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
some != NULL checks
[wxWidgets.git] / src / common / variant.cpp
index 4bcefec312a99acabecb44d35935cfc7c006327b..491cf8c470820e97c88a45285030123f82a62030 100644 (file)
@@ -11,6 +11,8 @@
 
 #ifdef __GNUG__
 #pragma implementation "variant.h"
+#pragma implementation "time.h"
+#pragma implementation "date.h"
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
     #pragma hdrstop
 #endif
 
-#if wxUSE_IOSTREAMH && wxUSE_STD_IOSTREAM
-#   include <fstream.h>
-#else
-#   include <fstream>
+#if wxUSE_STD_IOSTREAM
+    #if wxUSE_IOSTREAMH
+        #include <fstream.h>
+    #else
+        #include <fstream>
+    #endif
 #endif
 
 #if wxUSE_STREAMS
 #include "wx/string.h"
 #include "wx/variant.h"
 
+IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
+
+wxTime::tFormat    wxTime::ms_Format    = wxTime::wx12h;
+wxTime::tPrecision wxTime::ms_Precision  = wxTime::wxStdMinSec;
+
 IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
 
 wxVariant WXDLLEXPORT wxNullVariant;
@@ -377,7 +387,7 @@ bool wxVariantDataLong::Write(wxOutputStream& str) const
 {
     wxTextOutputStream s(str);
 
-    s.Write32(m_value);
+    s.Write32((size_t)m_value);
     return TRUE;
 }
 
@@ -818,7 +828,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataString, wxVariantData)
  * wxVariantDataTime
  */
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 
 class wxVariantDataTime: public wxVariantData
 {
@@ -1125,7 +1136,8 @@ wxVariant::wxVariant(const wxList& val, const wxString& name) // List of variant
     m_name = name;
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 wxVariant::wxVariant(const wxTime& val, const wxString& name) // Time
 {
     m_data = new wxVariantDataTime(val);
@@ -1429,7 +1441,8 @@ void wxVariant::operator= (const wxList& value)
     }
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 bool wxVariant::operator== (const wxTime& value) const
 {
     wxTime thisValue;
@@ -1662,7 +1675,8 @@ wxString wxVariant::GetString() const
     }
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 wxTime wxVariant::GetTime() const
 {
     wxTime value;
@@ -1862,7 +1876,8 @@ bool wxVariant::Convert(wxString* value) const
     return TRUE;
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 bool wxVariant::Convert(wxTime* value) const
 {
     wxString type(GetType());
@@ -1888,3 +1903,4 @@ bool wxVariant::Convert(wxDate* value) const
 }
 #endif
  // wxUSE_TIMEDATE
+