From a9b419af51e2ea1422e068bba91cbd85b08d4524 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Jul 2020 14:59:21 +0200 Subject: [PATCH] Fix code determining the rows to refresh in wxGrid::SetColSize() The changes in 15de1a4cf4 (Optimize refresh when resizing grid rows or columns, 2020-02-18) incorrectly translated XToPos() used in SetRowSize() to YToRow(), which compiled due to an implicit conversion of m_gridWin pointer to bool, but did the wrong thing, as the wrong grid window could be used for a frozen grid. Fix this by switching to internalYToRow() which actually does what the original code tried to do. Co-authored-by: Artur Wieczorek --- src/generic/grid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 5872622f9c..a9ff705bc4 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -9869,8 +9869,8 @@ void wxGrid::DoSetColSize( int col, int width ) CalcUnscrolledPosition(0, rect.GetTop(), NULL, &top); CalcUnscrolledPosition(0, rect.GetBottom(), NULL, &bottom); - const int rowTop = YToRow(top, m_gridWin); - const int rowBottom = YToRow(bottom, m_gridWin); + const int rowTop = internalYToRow(top, m_gridWin); + const int rowBottom = internalYToRow(bottom, m_gridWin); for ( int row = rowTop; row <= rowBottom; ++row ) { int numRows, numCols;