mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 17:39:22 +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;
|
Index: Integer;
|
||||||
Instance: TPersistent;
|
Instance: TPersistent;
|
||||||
begin
|
begin
|
||||||
if (ASelection=nil) or (Count=0) then begin
|
if (ASelection=nil) then begin
|
||||||
Result:=Count=0;
|
Result:=Count=0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Result:=Count=ASelection.Count;
|
||||||
|
if not Result then
|
||||||
|
exit;
|
||||||
Index:=0;
|
Index:=0;
|
||||||
for i:=0 to ASelection.Count-1 do
|
for i:=0 to ASelection.Count-1 do
|
||||||
begin
|
begin
|
||||||
Instance := ASelection[i];
|
Instance := ASelection[i];
|
||||||
if Instance is TPersistent then begin
|
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;
|
Result:=false;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
inc(Index);
|
inc(Index);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Result:=true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControlSelection.Assign(AControlSelection: TControlSelection);
|
procedure TControlSelection.Assign(AControlSelection: TControlSelection);
|
||||||
|
Loading…
Reference in New Issue
Block a user