]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/lboxcmn.cpp
Add missing WXK constants for the control keys
[wxWidgets.git] / src / common / lboxcmn.cpp
index ce0cbbb16efd4c07a8f61f11b88ae36579af11c2..0e1d05019365d2c6bad19c5782992dc6135085fe 100644 (file)
@@ -167,6 +167,14 @@ void wxListBoxBase::DeselectAll(int itemToLeaveSelected)
 
 void wxListBoxBase::UpdateOldSelections()
 {
+    // When the control becomes empty, any previously remembered selections are
+    // invalid anyhow, so just forget them.
+    if ( IsEmpty() )
+    {
+        m_oldSelections.clear();
+        return;
+    }
+
     // We need to remember the selection even in single-selection case on
     // Windows, so that we don't send an event when the user clicks on an
     // already selected item.