wxVListBox/wxHtmlListBox: GetSelection after SetItemCount
|Reported by:||belgabor||Owned by:|
I found a bug in wxHtmlListBox, but I suspect it goes down to wxVListBox. If you call SetItemCount and reduce the number of items, the current selection is not sanity-checked, so if you call GetSelection before user interaction with the control, it is possible that the index you get back is illegal.
The control should check on SetItemCount whether the currently selected item index is still < item count and either set it to the max or wxNOT_FOUND (-1) if not.
(Checked against current CVS Head)