]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
Add some version checks to help compiling on OSX.
[wxWidgets.git] / src / common / variant.cpp
index 371630d3223a7f4a012d331c8b60bb39a91e7abc..5f7daabe9a6f5b91d25f3992402a6f6f37c702fc 100644 (file)
@@ -1977,8 +1977,6 @@ protected:
 // Convert to/from list of wxAnys
 //
 
-WX_DEFINE_LIST(wxAnyList)
-
 bool wxVariantDataList::GetAsAny(wxAny* any) const
 {
     wxAnyList dst;
@@ -2360,6 +2358,15 @@ bool wxVariant::Convert(wxUniChar* value) const
         *value = (char) (((wxVariantDataLong*)GetData())->GetValue());
     else if (type == wxT("bool"))
         *value = (char) (((wxVariantDataBool*)GetData())->GetValue());
+    else if (type == wxS("string"))
+    {
+        // Also accept strings of length 1
+        const wxString& str = (((wxVariantDataString*)GetData())->GetValue());
+        if ( str.length() == 1 )
+            *value = str[0];
+        else
+            return false;
+    }
     else
         return false;