mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:19:14 +02:00
ide: optimized TCustomFormEditor.HasCircularDependencies a bit
git-svn-id: trunk@21278 -
This commit is contained in:
parent
e447466f59
commit
2dc39a2443
@ -1844,14 +1844,14 @@ end;
|
|||||||
|
|
||||||
function TCustomFormEditor.HasCircularDependencies(AClass: TComponentClass; AComponent: TComponent): Boolean;
|
function TCustomFormEditor.HasCircularDependencies(AClass: TComponentClass; AComponent: TComponent): Boolean;
|
||||||
|
|
||||||
function HasChild(WhatToTraverse, WhatToSearch: TComponent): Boolean;
|
function HasChild(WhatToTraverse: TComponent; WhatToSearch: TClass): Boolean;
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
for i := 0 to WhatToTraverse.ComponentCount - 1 do
|
for i := 0 to WhatToTraverse.ComponentCount - 1 do
|
||||||
begin
|
begin
|
||||||
Result := WhatToTraverse.Components[i].InheritsFrom(WhatToSearch.ClassType) or
|
Result := WhatToTraverse.Components[i].InheritsFrom(WhatToSearch) or
|
||||||
HasChild(WhatToTraverse.Components[i], WhatToSearch);
|
HasChild(WhatToTraverse.Components[i], WhatToSearch);
|
||||||
if Result then Exit;
|
if Result then Exit;
|
||||||
end;
|
end;
|
||||||
@ -1866,7 +1866,7 @@ begin
|
|||||||
if AnUnitInfo = nil then Exit;
|
if AnUnitInfo = nil then Exit;
|
||||||
Cmp := AnUnitInfo.Component;
|
Cmp := AnUnitInfo.Component;
|
||||||
if Cmp = nil then Exit;
|
if Cmp = nil then Exit;
|
||||||
Result := HasChild(Cmp, AComponent);
|
Result := HasChild(Cmp, AComponent.ClassType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomFormEditor.GetAncestorLookupRoot(AComponent: TComponent
|
function TCustomFormEditor.GetAncestorLookupRoot(AComponent: TComponent
|
||||||
|
Loading…
Reference in New Issue
Block a user