Fix deleting columns in wxGridStringTable with custom column labels.
We erroneously removed too many elements from m_colLabels array (basically we always removed all the elements remaining after this column, irrespectively of the actual number of columns to delete), fix this by removing at most the specified number of columns -- or possibly less if the array isn't entirely filled. See #13329. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1534,9 +1534,8 @@ bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols )
|
|||||||
// m_colLabels stores just as many elements as it needs, e.g. if only
|
// 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
|
// the label of the first column had been set it would have only one
|
||||||
// element and not numCols, so account for it
|
// element and not numCols, so account for it
|
||||||
int nToRm = m_colLabels.size() - colID;
|
int numRemaining = m_colLabels.size() - colID;
|
||||||
if ( nToRm > 0 )
|
m_colLabels.RemoveAt( colID, wxMin(numCols, numRemaining) );
|
||||||
m_colLabels.RemoveAt( colID, nToRm );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( numCols >= curNumCols )
|
if ( numCols >= curNumCols )
|
||||||
|
Reference in New Issue
Block a user