cocoa: fix the combobox itemindex when the new text is not the list

git-svn-id: trunk@59247 -
This commit is contained in:
jesus 2018-10-04 19:00:34 +00:00
parent ec89029ae5
commit a9e858cf2a

View File

@ -1166,8 +1166,14 @@ begin
// this is used for the case of the same items in the combobox
Result:=idx
else
begin
// todo: consider a faster search?
Result := list.IndexOf(string_.UTF8String);
idx := list.IndexOf(string_.UTF8String);
if idx<0 then
Result := NSNotFound
else
Result := idx;
end;
end;
function TCocoaComboBox.numberOfItemsInComboBox(combo:TCocoaComboBox):NSInteger;