]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datavcmn.cpp
Support float, double and file name values in wxGenericValidator.
[wxWidgets.git] / src / common / datavcmn.cpp
old mode 100755 (executable)
new mode 100644 (file)
index fa3d356..8e2469c
@@ -728,12 +728,15 @@ bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect la
 
 void wxDataViewRendererBase::DestroyEditControl()
 {
+    // Remove our event handler first to prevent it from (recursively) calling
+    // us again as it would do via a call to FinishEditing() when the editor
+    // loses focus when we hide it below.
+    wxEvtHandler * const handler = m_editorCtrl->PopEventHandler();
+
     // Hide the control immediately but don't delete it yet as there could be
     // some pending messages for it.
     m_editorCtrl->Hide();
 
-    wxEvtHandler * const handler = m_editorCtrl->PopEventHandler();
-
     wxPendingDelete.Append(handler);
     wxPendingDelete.Append(m_editorCtrl);
 }
@@ -743,8 +746,6 @@ void wxDataViewRendererBase::CancelEditing()
     if (!m_editorCtrl)
         return;
 
-    GetOwner()->GetOwner()->GetMainWindow()->SetFocus();
-
     DestroyEditControl();
 }