- if (m_growableCols[idx] < ncols)
- {
- temp.Add( m_growableCols[idx] );
- temp_proportions.Add( m_growableColsProportions[idx] );
- sum_proportions += m_growableColsProportions[idx];
- growable_space += m_colWidths[idx];
- }
+ // Since the number of rows/columns can change as items are inserted/deleted, we need
+ // to verify at runtime that the requested growable rows/columns are still valid.
+ if (m_growableCols[idx] >= ncols)
+ continue;
+ // If all items in a row/column are hidden, that row/column will have a dimension of -1.
+ // This causes the column to be hidden completely.
+ if (m_colWidths[ m_growableCols[idx] ] == -1)
+ continue;
+ sum_proportions += m_growableColsProportions[idx];
+ // wtb 5/12/02 bugfix - was m_ColWidths[idx]!!
+ growable_space += m_colWidths[ m_growableCols[idx] ];
+ num++;