Allow wxVariant::Convert(wxUniChar* value) to convert single-character string into a character.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-08-13 20:12:03 +00:00
parent 4082ff84e3
commit 15ec7f782d

View 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;