mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:28:19 +02:00
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:
parent
296e81dda3
commit
a905bdf46f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user