comctl32: In COMBOEX_FindStringExact do not try to get text from invalid items.

This commit is contained in:
Aric Stewart 2009-06-18 18:15:24 +09:00 committed by Alexandre Julliard
parent 872b4d40b5
commit e3b9420034
1 changed files with 2 additions and 0 deletions

View File

@ -860,10 +860,12 @@ COMBOEX_FindStringExact (COMBOEX_INFO *infoPtr, INT start, LPCWSTR str)
/* now search from after starting loc and wrapping back to start */
for(i=start+1; i<count; i++) {
CBE_ITEMDATA *item = get_item_data(infoPtr, i);
if ((LRESULT)item == CB_ERR) continue;
if (cmptext(COMBOEX_GetText(infoPtr, item), str) == 0) return i;
}
for(i=0; i<=start; i++) {
CBE_ITEMDATA *item = get_item_data(infoPtr, i);
if ((LRESULT)item == CB_ERR) continue;
if (cmptext(COMBOEX_GetText(infoPtr, item), str) == 0) return i;
}
return CB_ERR;