From: Jaakko Salli Date: Fri, 3 Oct 2008 17:39:17 +0000 (+0000) Subject: Fixed bug: wxPG_EX_AUTO_UNSPECIFIED_VALUES was basically always on X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/104837f26e17c1c58601dd24c16c5ffae69bf57c Fixed bug: wxPG_EX_AUTO_UNSPECIFIED_VALUES was basically always on git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 771b46fd0b..a2da90ed9e 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -892,6 +892,14 @@ bool wxPGProperty::OnEvent( wxPropertyGrid*, wxWindow*, wxEvent& ) void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags ) { + // If auto unspecified values are not wanted (via window or property style), + // then get default value instead of wxNullVariant. + if ( value.IsNull() && (flags & wxPG_SETVAL_BY_USER) && + !UsesAutoUnspecified() ) + { + value = GetDefaultValue(); + } + if ( !value.IsNull() ) { wxVariant tempListVariant;