// change state
static const unsigned MANY_ITEMS = 100;
- wxASSERT_MSG( itemFrom <= itemTo, _T("should be in order") );
+ wxASSERT_MSG( itemFrom <= itemTo, wxT("should be in order") );
// are we going to have more [un]selected items than the other ones?
if ( itemTo - itemFrom > m_count/2 )
while ( i < count )
{
// all following elements must be greater than the one we deleted
- wxASSERT_MSG( m_itemsSel[i] > item, _T("logic error") );
+ wxASSERT_MSG( m_itemsSel[i] > item, wxT("logic error") );
m_itemsSel[i++]--;
}
}
+void wxSelectionStore::SetItemCount(unsigned count)
+{
+ // forget about all items whose indices are now invalid if the size
+ // decreased
+ if ( count < m_count )
+ {
+ for ( size_t i = m_itemsSel.GetCount(); i > 0; i-- )
+ {
+ if ( m_itemsSel[i - 1] >= count )
+ m_itemsSel.RemoveAt(i - 1);
+ }
+ }
+
+ // remember the new number of items
+ m_count = count;
+}