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

View File

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