X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37788684ba0dfe52d3b4f67e5c2dae521893bfff..a7130edbab452196921daabd3748c3538e82607b:/src/common/lboxcmn.cpp diff --git a/src/common/lboxcmn.cpp b/src/common/lboxcmn.cpp index da8bc5f35d..0e1d050193 100644 --- a/src/common/lboxcmn.cpp +++ b/src/common/lboxcmn.cpp @@ -31,9 +31,10 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/arrstr.h" + #include "wx/log.h" #endif -#include "wx/log.h" +extern WXDLLEXPORT_DATA(const char) wxListBoxNameStr[] = "listBox"; // ============================================================================ // implementation @@ -166,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.