Ensure current cell remains valid when wxGrid table changes

Replacing the table used by the grid could make the current cell
coordinates invalid, resulting in asserts when trying to use it later.
Fix this by calling the same function which was already called when
changing the existing table.

See #23752.

Closes #23751.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
This commit is contained in:
Cookielau
2023-09-15 02:08:36 +02:00
committed by Vadim Zeitlin
co-authored by Vadim Zeitlin
parent 21f9366861
commit e570d85164
+2
View File
@@ -2912,6 +2912,8 @@ wxGrid::SetTable(wxGridTableBase *table,
InvalidateBestSize();
UpdateCurrentCellOnRedim();
return m_created;
}