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);
|
const wxPGProperty* child = Item(curChild);
|
||||||
|
|
||||||
wxVariant variant(child->GetValueRef());
|
wxVariant oldChildValue = child->GetValue();
|
||||||
if ( child->StringToValue( variant, token, propagatedFlags ) )
|
wxVariant variant(oldChildValue);
|
||||||
|
bool stvRes = child->StringToValue( variant, token, propagatedFlags );
|
||||||
|
if ( stvRes || (variant != oldChildValue) )
|
||||||
{
|
{
|
||||||
variant.SetName(child->GetBaseName());
|
if ( stvRes )
|
||||||
list.Append(variant);
|
changed = true;
|
||||||
changed = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Failed, becomes unspecified
|
// Failed, becomes unspecified
|
||||||
wxVariant variant2;
|
variant.MakeNull();
|
||||||
variant2.SetName(child->GetBaseName());
|
|
||||||
list.Append(variant2);
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variant.SetName(child->GetBaseName());
|
||||||
|
list.Append(variant);
|
||||||
|
|
||||||
curChild++;
|
curChild++;
|
||||||
if ( curChild >= iMax )
|
if ( curChild >= iMax )
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user