Clear old selection when wxListBox becomes empty.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Jun 2012 22:34:17 +0000 (22:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Jun 2012 22:34:17 +0000 (22:34 +0000)
commit0c9dd3b69bd0b3804d9b4c703364730770f5a723
tree2e8d5fae533af2d04bd3193268e7dd03ce96b66b
parent125afca0c0e4d060cb0edbf0c498048f7cb66c13
Clear old selection when wxListBox becomes empty.

When UpdateOldSelections() is called from wxListBox::DoClear(), it must clear
the old selections array even for single selection list boxes, but it didn't
do this under non-MSW platforms.

Specifically check for the case of an empty listbox now and just forget the
old selections then. This fixes the problem of keeping stale old selections
and is also more efficient as we avoid the unnecessary GetSelections() call.

Really closes #14359.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/common/lboxcmn.cpp