[ wxwindows-Bugs-1610999 ] wxVListBox/wxHtmlListBox: GetSelection after SetItemCount

SourceForge.net noreply at sourceforge.net
Thu Dec 7 10:28:14 PST 2006


Bugs item #1610999, was opened at 2006-12-07 19:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1610999&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxBase
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tobias Minich (belgabor)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxVListBox/wxHtmlListBox: GetSelection after SetItemCount

Initial Comment:
Hi,

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)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1610999&group_id=9863




More information about the wx-dev mailing list