]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug: wxPG_EX_AUTO_UNSPECIFIED_VALUES was basically always on
authorJaakko Salli <jaakko.salli@dnainternet.net>
Fri, 3 Oct 2008 17:39:17 +0000 (17:39 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Fri, 3 Oct 2008 17:39:17 +0000 (17:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/property.cpp

index 771b46fd0be627d77238b2a56add883708f7bfb8..a2da90ed9e6bde66ffb51662f3b784ebbd8be160 100644 (file)
@@ -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;