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.
This commit is contained in:
Iwbnwif Yiw
2015-05-10 03:13:35 +02:00
committed by Vadim Zeitlin
parent 1298f5970b
commit dd036218bd

View File

@@ -2714,7 +2714,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
for ( i = pos; i < m_numRows; i++ ) for ( i = pos; i < m_numRows; i++ )
{ {
bottom += m_rowHeights[i]; bottom += GetRowHeight(i);
m_rowBottoms[i] = bottom; m_rowBottoms[i] = bottom;
} }
} }
@@ -2759,7 +2759,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
for ( i = oldNumRows; i < m_numRows; i++ ) for ( i = oldNumRows; i < m_numRows; i++ )
{ {
bottom += m_rowHeights[i]; bottom += GetRowHeight(i);
m_rowBottoms[i] = bottom; m_rowBottoms[i] = bottom;
} }
} }
@@ -2795,7 +2795,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
int h = 0; int h = 0;
for ( i = 0; i < m_numRows; i++ ) for ( i = 0; i < m_numRows; i++ )
{ {
h += m_rowHeights[i]; h += GetRowHeight(i);
m_rowBottoms[i] = h; m_rowBottoms[i] = h;
} }
} }
@@ -2879,7 +2879,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
{ {
i = GetColAt( colPos ); i = GetColAt( colPos );
right += m_colWidths[i]; right += GetColWidth(i);
m_colRights[i] = right; m_colRights[i] = right;
} }
} }
@@ -2937,7 +2937,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
{ {
i = GetColAt( colPos ); i = GetColAt( colPos );
right += m_colWidths[i]; right += GetColWidth(i);
m_colRights[i] = right; m_colRights[i] = right;
} }
} }
@@ -2998,7 +2998,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
{ {
i = GetColAt( colPos ); i = GetColAt( colPos );
w += m_colWidths[i]; w += GetColWidth(i);
m_colRights[i] = w; m_colRights[i] = w;
} }
} }