X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29efc6e4a478652d6f59fb3f5ca7990d78a8ead4..a9a2485d6464928fcf1012e573f4b3b734238300:/src/generic/grideditors.cpp diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 997626c10e..abd9a3bb59 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -70,13 +70,20 @@ void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event) { // Don't disable the cell if we're just starting to edit it - if (m_inSetFocus) + if ( m_inSetFocus ) + { + event.Skip(); return; + } // accept changes m_grid->DisableCellEditControl(); - event.Skip(); + // notice that we must not skip the event here because the call above may + // delete the control which received the kill focus event in the first + // place and if we pretend not having processed the event, the search for a + // handler for it will continue using the now deleted object resulting in a + // crash } void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event) @@ -478,7 +485,10 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue) Text()->SetFocus(); } -bool wxGridCellTextEditor::EndEdit(const wxString& WXUNUSED(oldval), +bool wxGridCellTextEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& WXUNUSED(oldval), wxString *newval) { wxCHECK_MSG( m_control, false, @@ -674,7 +684,10 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid) } } -bool wxGridCellNumberEditor::EndEdit(const wxString& oldval, wxString *newval) +bool wxGridCellNumberEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& oldval, wxString *newval) { long value = 0; wxString text; @@ -879,7 +892,10 @@ void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid) DoBeginEdit(GetString()); } -bool wxGridCellFloatEditor::EndEdit(const wxString& oldval, wxString *newval) +bool wxGridCellFloatEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& oldval, wxString *newval) { const wxString text(Text()->GetValue()); @@ -1175,7 +1191,10 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid) CBox()->SetFocus(); } -bool wxGridCellBoolEditor::EndEdit(const wxString& WXUNUSED(oldval), +bool wxGridCellBoolEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& WXUNUSED(oldval), wxString *newval) { bool value = CBox()->GetValue(); @@ -1363,7 +1382,10 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid) } } -bool wxGridCellChoiceEditor::EndEdit(const wxString& WXUNUSED(oldval), +bool wxGridCellChoiceEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& WXUNUSED(oldval), wxString *newval) { const wxString value = Combo()->GetValue(); @@ -1481,7 +1503,10 @@ void wxGridCellEnumEditor::BeginEdit(int row, int col, wxGrid* grid) } -bool wxGridCellEnumEditor::EndEdit(const wxString& WXUNUSED(oldval), +bool wxGridCellEnumEditor::EndEdit(int WXUNUSED(row), + int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& WXUNUSED(oldval), wxString *newval) { long idx = Combo()->GetSelection();