]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgrid.cpp
cleanup
[wxWidgets.git] / src / propgrid / propgrid.cpp
index e98e86097cd35ba115e5825a0bcb43a6b72b7876..413443ad04aca9a1554e46910c3c104b2bc03d80 100644 (file)
@@ -3266,7 +3266,6 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
     if ( m_inDoPropertyChanged )
         return true;
 
-    wxWindow* editor = GetEditorControl();
     wxPGProperty* selected = GetSelection();
 
     m_pState->m_anyModified = 1;
@@ -3290,6 +3289,10 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
 
     changedProperty->SetValue(value, &m_chgInfo_valueList, wxPG_SETVAL_BY_USER);
 
+    // NB: Call GetEditorControl() as late as possible, because OnSetValue()
+    //     and perhaps other user-defined virtual functions may change it.
+    wxWindow* editor = GetEditorControl();
+
     // Set as Modified (not if dragging just began)
     if ( !(p->m_flags & wxPG_PROP_MODIFIED) )
     {