Do not incorrectly interprete StringToValue() returning false to mean that it failed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -774,22 +774,24 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
|
||||
|
||||
const wxPGProperty* child = Item(curChild);
|
||||
|
||||
wxVariant variant(child->GetValueRef());
|
||||
if ( child->StringToValue( variant, token, propagatedFlags ) )
|
||||
wxVariant oldChildValue = child->GetValue();
|
||||
wxVariant variant(oldChildValue);
|
||||
bool stvRes = child->StringToValue( variant, token, propagatedFlags );
|
||||
if ( stvRes || (variant != oldChildValue) )
|
||||
{
|
||||
variant.SetName(child->GetBaseName());
|
||||
list.Append(variant);
|
||||
changed = true;
|
||||
if ( stvRes )
|
||||
changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Failed, becomes unspecified
|
||||
wxVariant variant2;
|
||||
variant2.SetName(child->GetBaseName());
|
||||
list.Append(variant2);
|
||||
variant.MakeNull();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
variant.SetName(child->GetBaseName());
|
||||
list.Append(variant);
|
||||
|
||||
curChild++;
|
||||
if ( curChild >= iMax )
|
||||
break;
|
||||
|
Reference in New Issue
Block a user