From 3a72cd0a987cb0579db3d7113947d25d3e94fef7 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 18 Feb 2013 20:40:17 +0000 Subject: [PATCH] cody: unit dependencies: show units of selected groups git-svn-id: trunk@40349 - --- components/codetools/ide/codyunitdepwnd.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/codetools/ide/codyunitdepwnd.pas b/components/codetools/ide/codyunitdepwnd.pas index a3f8b3e52f..55cdd01bb6 100644 --- a/components/codetools/ide/codyunitdepwnd.pas +++ b/components/codetools/ide/codyunitdepwnd.pas @@ -571,7 +571,10 @@ var CurUses: TUGUses; SourceGraphNode: TLvlGraphNode; TargetGraphNode: TLvlGraphNode; + NewGroups: TStringToPointerTree; + UsedUnit: TUGGroupUnit; begin + NewGroups:=TStringToPointerTree.Create(false); NewUnits:=TFilenameToPointerTree.Create(false); try // fetch new list of units @@ -579,6 +582,7 @@ begin while GraphGroup<>nil do begin UnitGroup:=TUGGroup(GraphGroup.Data); if UnitGroup<>nil then begin + NewGroups[UnitGroup.Name]:=UnitGroup; AVLNode:=UnitGroup.Units.FindLowest; while AVLNode<>nil do begin GroupUnit:=TUGGroupUnit(AVLNode.Data); @@ -615,7 +619,10 @@ begin if GroupUnit.UsesUnits<>nil then begin for i:=0 to GroupUnit.UsesUnits.Count-1 do begin CurUses:=TUGUses(GroupUnit.UsesUnits[i]); - TargetGraphNode:=Graph.GetNode(UnitToCaption(CurUses.UsesUnit),true); + UsedUnit:=TUGGroupUnit(CurUses.UsesUnit); + if UsedUnit.Group=nil then continue; + if not NewGroups.Contains(UsedUnit.Group.Name) then continue; + TargetGraphNode:=Graph.GetNode(UnitToCaption(UsedUnit),true); Graph.GetEdge(SourceGraphNode,TargetGraphNode,true); end; end; @@ -624,6 +631,7 @@ begin UnitsLvlGraph.EndUpdate; finally + NewGroups.Free; NewUnits.Free; end; end;