]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow wxVariant::Convert(wxUniChar* value) to convert single-character string into...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Fri, 13 Aug 2010 20:12:03 +0000 (20:12 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Fri, 13 Aug 2010 20:12:03 +0000 (20:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/variant.cpp

index 371630d3223a7f4a012d331c8b60bb39a91e7abc..207c3a4f30de58dd19c656accf0cf112939f7200 100644 (file)
@@ -2360,6 +2360,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;