don't delete inexistent column indices in DeleteCols()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-02-16 17:41:58 +00:00
parent 97a8589874
commit b2df5ddf6a

View File

@ -3648,7 +3648,12 @@ bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols )
if ( !m_colLabels.IsEmpty() )
{
m_colLabels.RemoveAt( colID, numCols );
// m_colLabels stores just as many elements as it needs, e.g. if only
// the label of the first column had been set it would have only one
// element and not numCols, so account for it
int nToRm = m_colLabels.size() - colID;
if ( nToRm > 0 )
m_colLabels.RemoveAt( colID, nToRm );
}
for ( row = 0; row < curNumRows; row++ )