From cc98c7851037d270c3c577be54a460b126bc4cdb Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sat, 24 Apr 2010 10:02:25 +0000 Subject: [PATCH] In wxPropertyGrid::DoPropertyChanged(), call GetEditorControl() as late as possible so that editor can be changed in wxPGProperty::OnSetValue() (fixes #11987) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index e98e860..413443a 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -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) ) { -- 2.7.4