]> git.saurik.com Git - wxWidgets.git/commitdiff
Make m_inDoPropertyChanged and m_inCommitChangesFromEditor bools; Manage m_inDoProper...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 4 Jul 2010 11:21:27 +0000 (11:21 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 4 Jul 2010 11:21:27 +0000 (11:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/propgrid.cpp

index 3e85ef42857e2f22a4af0ab3469c992d1c76ad67..dfa37fca3610ad2ffa2496f1b0e4531dcc73f144 100644 (file)
@@ -1932,10 +1932,10 @@ protected:
     unsigned char       m_keyComboConsumed;
 
     /** 1 if in DoPropertyChanged() */
     unsigned char       m_keyComboConsumed;
 
     /** 1 if in DoPropertyChanged() */
-    unsigned char       m_inDoPropertyChanged;
+    bool                m_inDoPropertyChanged;
 
     /** 1 if in CommitChangesFromEditor() */
 
     /** 1 if in CommitChangesFromEditor() */
-    unsigned char       m_inCommitChangesFromEditor;
+    bool                m_inCommitChangesFromEditor;
 
     /** 1 if in DoSelectProperty() */
     bool                m_inDoSelectProperty;
 
     /** 1 if in DoSelectProperty() */
     bool                m_inDoSelectProperty;
index 50a9f09d4d571cda3868023511d7662f02c08d29..1b01f72f5e47e62d0eae8a7c966f231b2482645f 100644 (file)
@@ -341,9 +341,9 @@ void wxPropertyGrid::Init1()
     m_curFocused = NULL;
     m_processedEvent = NULL;
     m_sortFunction = NULL;
     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;
     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_iFlags & wxPG_FL_INITIALIZED) &&
          selected )
     {
-        m_inCommitChangesFromEditor = 1;
+        m_inCommitChangesFromEditor = true;
 
         wxVariant variant(selected->GetValueRef());
         bool valueIsPending = false;
 
         wxVariant variant(selected->GetValueRef());
         bool valueIsPending = false;
@@ -2944,9 +2944,9 @@ bool wxPropertyGrid::CommitChangesFromEditor( wxUint32 flags )
             EditorsValueWasNotModified();
         }
 
             EditorsValueWasNotModified();
         }
 
-        bool res = true;
+        m_inCommitChangesFromEditor = false;
 
 
-        m_inCommitChangesFromEditor = 0;
+        bool res = true;
 
         if ( validationFailure && !forceSuccess )
         {
 
         if ( validationFailure && !forceSuccess )
         {
@@ -3351,12 +3351,13 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
     if ( m_inDoPropertyChanged )
         return true;
 
     if ( m_inDoPropertyChanged )
         return true;
 
+    m_inDoPropertyChanged = true;
+    wxON_BLOCK_EXIT_SET(m_inDoPropertyChanged, false);
+
     wxPGProperty* selected = GetSelection();
 
     m_pState->m_anyModified = 1;
 
     wxPGProperty* selected = GetSelection();
 
     m_pState->m_anyModified = 1;
 
-    m_inDoPropertyChanged = 1;
-
     // If property's value is being changed, assume it is valid
     OnValidationFailureReset(selected);
 
     // 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 );
 
 
     SendEvent( wxEVT_PG_CHANGED, changedProperty, NULL );
 
-    m_inDoPropertyChanged = 0;
-
     return true;
 }
 
     return true;
 }