From 2bbd3749230facacae63d4695a24bb967537bbab Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Tue, 16 Sep 2008 17:00:28 +0000 Subject: [PATCH] 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 --- src/propgrid/property.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index fa7702ddbb..0936589da7 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -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; -- 2.45.2