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
This commit is contained in:
Artur Wieczorek
2015-02-16 20:38:33 +00:00
parent fd7ea006e9
commit 63e678d978

View File

@@ -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() &&