recognize 0/1 as false/true in string->bool conversion (patch 1249632)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2038,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;
|
||||
|
Reference in New Issue
Block a user