IDE: fixed unit flag indirectly used by designer, bug #12553

git-svn-id: trunk@17425 -
This commit is contained in:
mattias 2008-11-18 15:18:54 +00:00
parent c57891fc93
commit b3ad804aa7
2 changed files with 10 additions and 9 deletions

View File

@ -6110,7 +6110,7 @@ begin
DebugLn(['TMainIDE.CloseUnitComponent ',AnUnitInfo.Filename,' ',dbgsName(LookupRoot)]);
{$ENDIF}
Project1.LockUnitComponentDependencies;
Project1.LockUnitComponentDependencies; // avoid circles
try
// save
if (cfSaveFirst in Flags) and (AnUnitInfo.EditorIndex>=0)
@ -6269,6 +6269,7 @@ begin
Project1.UpdateUnitComponentDependencies;
if Project1.UnitComponentIsUsed(AnUnitInfo,CheckHasDesigner) then
exit(true);
//DebugLn(['TMainIDE.UnitComponentIsUsed ',AnUnitInfo.Filename,' ',dbgs(AnUnitInfo.Flags)]);
end;
function TMainIDE.GetAncestorUnit(AnUnitInfo: TUnitInfo): TUnitInfo;

View File

@ -1144,7 +1144,7 @@ procedure TUnitInfo.WriteDebugReportUnitComponentDependencies(Prefix: string);
var
Dependency: TUnitComponentDependency;
begin
DebugLn([Prefix+'TUnitInfo.WriteDebugReportUnitComponentDependencies ',Filename]);
DebugLn([Prefix+'TUnitInfo.WriteDebugReportUnitComponentDependencies ',Filename,' ',dbgs(Flags)]);
Dependency:=FirstRequiredComponent;
if Dependency<>nil then begin
DebugLn([Prefix+' Requires: >>> ']);
@ -3734,7 +3734,7 @@ procedure TProject.UpdateUnitComponentDependencies;
until TypeInfo=nil;
end;
procedure DFSUsedByDesigner(AnUnitInfo, IgnoreUnitInfo: TUnitInfo);
procedure DFSRequiredDesigner(AnUnitInfo, IgnoreUnitInfo: TUnitInfo);
var
Dependency: TUnitComponentDependency;
UsingUnitInfo: TUnitInfo;
@ -3743,19 +3743,19 @@ procedure TProject.UpdateUnitComponentDependencies;
or (uifMarked in AnUnitInfo.FFlags) then
exit;
Include(AnUnitInfo.FFlags,uifMarked);
Dependency:=AnUnitInfo.FirstUsedByComponent;
Dependency:=AnUnitInfo.FirstRequiredComponent;
while Dependency<>nil do begin
UsingUnitInfo:=Dependency.UsedByUnit;
UsingUnitInfo:=Dependency.RequiresUnit;
if (UsingUnitInfo<>IgnoreUnitInfo)
and (not (uifComponentIndirectlyUsedByDesigner in UsingUnitInfo.FFlags))
then begin
{$IFDEF VerboseIDEMultiForm}
DebugLn(['TProject.UpdateUnitComponentDependencies.DFSUsedByDesigner designer of ',UsingUnitInfo.Filename,' uses ',AnUnitInfo.Filename]);
DebugLn(['TProject.UpdateUnitComponentDependencies.DFSRequiredDesigner designer of ',AnUnitInfo.Filename,' uses ',UsingUnitInfo.Filename]);
{$ENDIF}
Include(UsingUnitInfo.FFlags,uifComponentIndirectlyUsedByDesigner);
DFSUsedByDesigner(UsingUnitInfo,IgnoreUnitInfo);
DFSRequiredDesigner(UsingUnitInfo,IgnoreUnitInfo);
end;
Dependency:=Dependency.NextUsedByDependency;
Dependency:=Dependency.NextRequiresDependency;
end;
end;
@ -3808,7 +3808,7 @@ begin
begin
// mark all that use indirectly this designer
Exclude(AnUnitInfo.FFlags,uifMarked);
DFSUsedByDesigner(AnUnitInfo,AnUnitInfo);
DFSRequiredDesigner(AnUnitInfo,AnUnitInfo);
end;
AnUnitInfo:=AnUnitInfo.NextUnitWithComponent;
end;