mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:54:03 +02:00
cocoa: fix the combobox itemindex when the new text is not the list
git-svn-id: trunk@59247 -
This commit is contained in:
parent
ec89029ae5
commit
a9e858cf2a
@ -1166,8 +1166,14 @@ begin
|
|||||||
// this is used for the case of the same items in the combobox
|
// this is used for the case of the same items in the combobox
|
||||||
Result:=idx
|
Result:=idx
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
// todo: consider a faster search?
|
// 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;
|
end;
|
||||||
|
|
||||||
function TCocoaComboBox.numberOfItemsInComboBox(combo:TCocoaComboBox):NSInteger;
|
function TCocoaComboBox.numberOfItemsInComboBox(combo:TCocoaComboBox):NSInteger;
|
||||||
|
Loading…
Reference in New Issue
Block a user