Avoid assert if there is no selection in wxListCtrl::DeleteItem()

Don't try making the current item visible if there is no current item.

This is another fix after 99d7b13e3f (in
addition to the previous 925a1c0734).
This commit is contained in:
Vadim Zeitlin 2017-11-07 02:41:24 +01:00
parent cacb49c4ad
commit 79d35109f0

View File

@ -4097,7 +4097,7 @@ void wxListMainWindow::DeleteItem( long lindex )
// with many items, the vertical scroll position may change so that the new
// last item is not visible any longer, which is very annoying from the
// user point of view. Ensure that whatever happens, this item is visible.
if (count > 1)
if ( count > 1 && m_current != (size_t)-1 )
EnsureVisible(m_current);
}