- // we're going to need m_colAt now, initialize it if needed
- if ( m_colAt.empty() )
- {
- m_colAt.reserve(m_numCols);
- for ( int i = 0; i < m_numCols; i++ )
- m_colAt.push_back(i);
- }
-
- wxHeaderCtrl::MoveColumnInOrderArray(m_colAt, idx, pos);
-
- // also recalculate the column rights
- if ( !m_colWidths.IsEmpty() )
+ // recalculate the column rights as the column positions have changed,
+ // unless we calculate them dynamically because all columns widths are the
+ // same and it's easy to do
+ if ( !m_colWidths.empty() )