Fix refreshing wxGenericListCtrl with multiple selection
Changing the selection could behave wrongly and result in an assert failure as the selection anchor could have become invalid, due to the change of the number of items in the control. Fix this by invalidating it when this happens.
This commit is contained in:
parent
99febcf9c1
commit
5885eea5ea
1 changed files with 4 additions and 0 deletions
|
|
@ -3730,6 +3730,10 @@ void wxListMainWindow::SetItemCount(long count)
|
|||
if ( HasCurrent() && m_current >= (size_t)count )
|
||||
ChangeCurrent(count - 1);
|
||||
|
||||
// And do the same thing for the multiple selection anchor.
|
||||
if ( m_anchor != (size_t)-1 && m_anchor >= (size_t)count )
|
||||
m_anchor = count - 1;
|
||||
|
||||
m_selStore.SetItemCount(count);
|
||||
m_countVirt = count;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue