prevent setting itemindex -1

git-svn-id: trunk@8234 -
This commit is contained in:
micha 2005-11-28 21:43:09 +00:00
parent 5a28a8fb1e
commit a4f6996c21

View File

@ -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;