mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 00:00:16 +02:00
prevent setting itemindex -1
git-svn-id: trunk@8234 -
This commit is contained in:
parent
5a28a8fb1e
commit
a4f6996c21
@ -842,6 +842,7 @@ end;
|
||||
procedure TCustomComboBox.UpdateSorted;
|
||||
var
|
||||
lText: string;
|
||||
lIndex: integer;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
TWSCustomComboBoxClass(WidgetSetClass).Sort(Self, Items, FSorted)
|
||||
@ -850,7 +851,9 @@ begin
|
||||
// remember text
|
||||
lText := Text;
|
||||
TStringList(FItems).Sorted := FSorted;
|
||||
ItemIndex := FItems.IndexOf(lText);
|
||||
lIndex := FItems.IndexOf(lText);
|
||||
if lIndex >= 0 then
|
||||
ItemIndex := lIndex;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user