From c0e28504ec0322afb12913db59d2218c96e274c0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 31 Dec 2007 20:12:59 +0000 Subject: [PATCH] Ensure AutoComp items with no type will set the item's image index to -1. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/PlatWX.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index ab2cb5c06a..68e32fc29f 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -1201,13 +1201,14 @@ void ListBoxImpl::Append(char *s, int type) { void ListBoxImpl::Append(const wxString& text, int type) { long count = GETLB(id)->GetItemCount(); long itemID = GETLB(id)->InsertItem(count, wxEmptyString); + long idx = -1; GETLB(id)->SetItem(itemID, 1, text); maxStrWidth = wxMax(maxStrWidth, text.length()); if (type != -1) { wxCHECK_RET(imgTypeMap, wxT("Unexpected NULL imgTypeMap")); - long idx = imgTypeMap->Item(type); - GETLB(id)->SetItemImage(itemID, idx, idx); + idx = imgTypeMap->Item(type); } + GETLB(id)->SetItemImage(itemID, idx, idx); } void ListBoxImpl::SetList(const char* list, char separator, char typesep) {