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:
parent
97a8589874
commit
b2df5ddf6a
@ -3648,7 +3648,12 @@ bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols )
|
|||||||
|
|
||||||
if ( !m_colLabels.IsEmpty() )
|
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++ )
|
for ( row = 0; row < curNumRows; row++ )
|
||||||
|
Loading…
Reference in New Issue
Block a user