From dd036218bdaa29dfc11cdc7d6a21ddaf74fa79ed Mon Sep 17 00:00:00 2001 From: Iwbnwif Yiw Date: Sun, 10 May 2015 03:13:35 +0200 Subject: [PATCH] Update wxGrid correctly in presence of hidden rows/columns. Use GetRowHeight()/GetColWidth() instead of accessing m_rowHeights/m_colWidths arrays directly as the functions handle the hidden rows/columns correctly. This fixes bug with corruption of wxGrid appearance if any rows/columns were inserted into or deleted from a grid containing some hidden rows/columns. Closes #16980. --- src/generic/grid.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index d696f1044c..c130ecd891 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2714,7 +2714,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) for ( i = pos; i < m_numRows; i++ ) { - bottom += m_rowHeights[i]; + bottom += GetRowHeight(i); m_rowBottoms[i] = bottom; } } @@ -2759,7 +2759,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) for ( i = oldNumRows; i < m_numRows; i++ ) { - bottom += m_rowHeights[i]; + bottom += GetRowHeight(i); m_rowBottoms[i] = bottom; } } @@ -2795,7 +2795,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) int h = 0; for ( i = 0; i < m_numRows; i++ ) { - h += m_rowHeights[i]; + h += GetRowHeight(i); m_rowBottoms[i] = h; } } @@ -2879,7 +2879,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) { i = GetColAt( colPos ); - right += m_colWidths[i]; + right += GetColWidth(i); m_colRights[i] = right; } } @@ -2937,7 +2937,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) { i = GetColAt( colPos ); - right += m_colWidths[i]; + right += GetColWidth(i); m_colRights[i] = right; } } @@ -2998,7 +2998,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) { i = GetColAt( colPos ); - w += m_colWidths[i]; + w += GetColWidth(i); m_colRights[i] = w; } }