From: Jaakko Salli Date: Sun, 4 Jul 2010 11:21:27 +0000 (+0000) Subject: Make m_inDoPropertyChanged and m_inCommitChangesFromEditor bools; Manage m_inDoProper... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/88f47aa77007c55ec0a8f1a48e429cb0ad050fe5?ds=inline Make m_inDoPropertyChanged and m_inCommitChangesFromEditor bools; Manage m_inDoPropertyChanged using wxON_BLOCK_EXIT_SET() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 3e85ef4285..dfa37fca36 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1932,10 +1932,10 @@ protected: unsigned char m_keyComboConsumed; /** 1 if in DoPropertyChanged() */ - unsigned char m_inDoPropertyChanged; + bool m_inDoPropertyChanged; /** 1 if in CommitChangesFromEditor() */ - unsigned char m_inCommitChangesFromEditor; + bool m_inCommitChangesFromEditor; /** 1 if in DoSelectProperty() */ bool m_inDoSelectProperty; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 50a9f09d4d..1b01f72f5e 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -341,9 +341,9 @@ void wxPropertyGrid::Init1() m_curFocused = NULL; m_processedEvent = NULL; m_sortFunction = NULL; - m_inDoPropertyChanged = 0; - m_inCommitChangesFromEditor = 0; - m_inDoSelectProperty = 0; + m_inDoPropertyChanged = false; + m_inCommitChangesFromEditor = false; + m_inDoSelectProperty = false; m_inOnValidationFailure = false; m_permanentValidationFailureBehavior = wxPG_VFB_DEFAULT; m_dragStatus = 0; @@ -2909,7 +2909,7 @@ bool wxPropertyGrid::CommitChangesFromEditor( wxUint32 flags ) (m_iFlags & wxPG_FL_INITIALIZED) && selected ) { - m_inCommitChangesFromEditor = 1; + m_inCommitChangesFromEditor = true; wxVariant variant(selected->GetValueRef()); bool valueIsPending = false; @@ -2944,9 +2944,9 @@ bool wxPropertyGrid::CommitChangesFromEditor( wxUint32 flags ) EditorsValueWasNotModified(); } - bool res = true; + m_inCommitChangesFromEditor = false; - m_inCommitChangesFromEditor = 0; + bool res = true; if ( validationFailure && !forceSuccess ) { @@ -3351,12 +3351,13 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) if ( m_inDoPropertyChanged ) return true; + m_inDoPropertyChanged = true; + wxON_BLOCK_EXIT_SET(m_inDoPropertyChanged, false); + wxPGProperty* selected = GetSelection(); m_pState->m_anyModified = 1; - m_inDoPropertyChanged = 1; - // If property's value is being changed, assume it is valid OnValidationFailureReset(selected); @@ -3448,8 +3449,6 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) SendEvent( wxEVT_PG_CHANGED, changedProperty, NULL ); - m_inDoPropertyChanged = 0; - return true; }