IDE: fixed comparing selections if one of the selections is empty (bug #9062) patch from Yuri + improvement

git-svn-id: trunk@11393 -
This commit is contained in:
vincents 2007-06-27 12:42:51 +00:00
parent 296e81dda3
commit a905bdf46f

View File

@ -1942,23 +1942,25 @@ var
Index: Integer;
Instance: TPersistent;
begin
if (ASelection=nil) or (Count=0) then begin
if (ASelection=nil) then begin
Result:=Count=0;
exit;
end;
Result:=Count=ASelection.Count;
if not Result then
exit;
Index:=0;
for i:=0 to ASelection.Count-1 do
begin
Instance := ASelection[i];
if Instance is TPersistent then begin
if (Index>=Count) or (Items[Index].Persistent<>Instance) then begin
if Items[Index].Persistent<>Instance then begin
Result:=false;
exit;
end;
inc(Index);
end;
end;
Result:=true;
end;
procedure TControlSelection.Assign(AControlSelection: TControlSelection);