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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user