X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/704bc4363b87a6e43368bd212749781e975eb820..a25484eb1391b53e6f0c1205af4b3a23183e512e:/src/generic/odcombo.cpp diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index d04d183089..fa036b21e2 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -1027,13 +1027,29 @@ int wxOwnerDrawnComboBox::DoInsertItems(const wxArrayStringsAdapter& items, EnsurePopupControl(); const unsigned int count = items.GetCount(); - for( unsigned int i = 0; i < count; ++i, ++pos ) + + if ( HasFlag(wxCB_SORT) ) { - GetVListBoxComboPopup()->Insert(items[i], pos); - AssignNewItemClientData(pos, clientData, i, type); + int n = pos; + + for ( unsigned int i = 0; i < count; ++i ) + { + int n = GetVListBoxComboPopup()->Append(items[i]); + AssignNewItemClientData(n, clientData, i, type); + } + + return n; } + else + { + for ( unsigned int i = 0; i < count; ++i, ++pos ) + { + GetVListBoxComboPopup()->Insert(items[i], pos); + AssignNewItemClientData(pos, clientData, i, type); + } - return pos - 1; + return pos - 1; + } } void wxOwnerDrawnComboBox::DoSetItemClientData(unsigned int n, void* clientData)