Fix another possible bug in wxEVT_GRID_CELL_CHANGED handling

Even when wxEVT_GRID_CELL_CHANGED is really vetoed, it's still possible
that m_currentCellCoords was changed by the handler, so use the row/col
coordinates of the cell that was really changed instead of the possibly
different m_currentCellCoords value to avoid a bug similar to the one
fixed by the previous commit.
This commit is contained in:
Vadim Zeitlin
2020-06-30 19:15:15 +02:00
parent 8445d1993e
commit 13e1b384e7

View File

@@ -7531,7 +7531,11 @@ void wxGrid::DoSaveEditControlValue()
if ( SendEvent(wxEVT_GRID_CELL_CHANGED, oldval) == Event_Vetoed )
{
// Event has been vetoed, set the data back.
SetCellValue(m_currentCellCoords, oldval);
//
// Note that we must use row and col here, which are sure to
// not have been changed, while m_currentCellCoords could have
// been changed by the event handler.
SetCellValue(row, col, oldval);
}
}
}