]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
added wxStaticText::Wrap()
[wxWidgets.git] / src / common / variant.cpp
index 4600c1a208ffac9dd4330a364d01672675370d94..bf9045cbb54c1642c9d4568d4c1840468a43264c 100644 (file)
@@ -304,7 +304,7 @@ bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
     return false;
 }
 
-#endif //2.4 compat 
+#endif //2.4 compat
 
 /*
  * wxVariantDataLong
@@ -1068,7 +1068,7 @@ bool wxVariantDataDateTime::Eq(wxVariantData& data) const
 
 
 #if wxUSE_STD_IOSTREAM
-bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
+bool wxVariantDataDateTime::Write(wxSTD ostream& WXUNUSED(str)) const
 {
     // Not implemented
     return false;
@@ -1156,7 +1156,7 @@ bool wxVariantDataArrayString::Eq(wxVariantData& data) const
 
 
 #if wxUSE_STD_IOSTREAM
-bool wxVariantDataArrayString::Write(wxSTD ostream& str) const
+bool wxVariantDataArrayString::Write(wxSTD ostream& WXUNUSED(str)) const
 {
     // Not implemented
     return false;
@@ -1558,7 +1558,10 @@ bool wxVariant::operator== (const wxStringList& value) const
 
 bool wxVariant::operator!= (const wxStringList& value) const
 {
-    return (!((*this) == value));
+    wxASSERT_MSG( (GetType() == wxT("stringlist")), wxT("Invalid type for == operator") );
+
+    wxVariantDataStringList other(value);
+    return !(m_data->Eq(other));
 }
 
 void wxVariant::operator= (const wxStringList& value)
@@ -1991,7 +1994,7 @@ void wxVariant::ClearList()
     }
     else
     {
-        if (GetType() != wxT("list"))
+        if (!GetType().IsSameAs(wxT("list")))
         {
             delete m_data;
             m_data = NULL;
@@ -2035,9 +2038,9 @@ bool wxVariant::Convert(bool* value) const
     {
         wxString val(((wxVariantDataString*)GetData())->GetValue());
         val.MakeLower();
-        if (val == wxT("true") || val == wxT("yes"))
+        if (val == wxT("true") || val == wxT("yes") || val == wxT('1') )
             *value = true;
-        else if (val == wxT("false") || val == wxT("no"))
+        else if (val == wxT("false") || val == wxT("no") || val == wxT('0') )
             *value = false;
         else
             return false;