From 63e678d97872e856852d8d9594fde1b104f49642 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 16 Feb 2015 20:38:33 +0000 Subject: [PATCH] Fix saving edited property value when wxPG property is in the 'invalid value' state. When wxPGProperty is loosing focus in 'invalid value' state its pending value should be stored before resetting property to 'normal' state because this operation (wxPG::OnValidationFailureReset) also resets pending value. This is the backport of r77887. See #16587. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 925c2bf6fa..c2c12a13b9 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3341,9 +3341,6 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) m_pState->m_anyModified = 1; - // If property's value is being changed, assume it is valid - OnValidationFailureReset(selected); - // Maybe need to update control wxASSERT( m_chgInfo_changedProperty != NULL ); @@ -3351,6 +3348,9 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) wxPGProperty* changedProperty = m_chgInfo_changedProperty; wxVariant value = m_chgInfo_pendingValue; + // If property's value is being changed, assume it is valid + OnValidationFailureReset(selected); + wxPGProperty* topPaintedProperty = changedProperty; while ( !topPaintedProperty->IsCategory() &&