IDE: multi form props: checking for TComponent descendants

git-svn-id: trunk@14915 -
This commit is contained in:
mattias 2008-04-21 07:44:30 +00:00
parent 4abf2fab7c
commit 62f6ee1fed
2 changed files with 7 additions and 5 deletions

View File

@ -5451,6 +5451,7 @@ begin
NewUnitName:=ExtractFileNameOnly(AnUnitInfo.Filename);
NewComponent:=FormEditor1.CreateRawComponentFromStream(BinStream,
AncestorType,AncestorBinStream,copy(NewUnitName,1,255),true);
Project1.InvalidateUnitComponentDesignerDependencies;
AnUnitInfo.Component:=NewComponent;
if (AncestorUnitInfo<>nil) then
AnUnitInfo.AddRequiresComponentDependency(AncestorUnitInfo,[ucdtAncestor]);

View File

@ -3508,11 +3508,12 @@ procedure TProject.UpdateUnitComponentDependencies;
while CurCount>0 do begin
// point PropInfo to next propinfo record.
// Located at Name[Length(Name)+1] !
if (PropInfo^.PropType=ClassTypeInfo(TComponent)) then begin
// property of kind TComponent
if (PropInfo^.PropType^.Kind=tkClass) then begin
// property of kind TObject
ReferenceComponent:=TComponent(GetObjectProp(AComponent,PropInfo));
//debugln('TProject.UpdateUnitComponentDependencies Property ',dbgsName(AComponent),' Name=',PropInfo^.Name,' Type=',PropInfo^.PropType^.Name,' Value=',dbgsName(ReferenceComponent),' TypeInfo=',TypeInfo^.Name);
if ReferenceComponent<>nil then begin
if ReferenceComponent is TComponent then begin
// reference is a TComponent
OwnerComponent:=ReferenceComponent;
while OwnerComponent.Owner<>nil do
OwnerComponent:=OwnerComponent.Owner;
@ -3660,8 +3661,8 @@ procedure TProject.FindUnitsUsingSubComponent(SubComponent: TComponent;
while CurCount>0 do begin
// point PropInfo to next propinfo record.
// Located at Name[Length(Name)+1] !
if (PropInfo^.PropType=ClassTypeInfo(TComponent)) then begin
// property of kind TComponent
if PropInfo^.PropType^.Kind=tkClass then begin
// property of kind TObject
ReferenceComponent:=TComponent(GetObjectProp(AComponent,PropInfo));
//debugln('TProject.FindUnitsUsingSubComponent Property ',dbgsName(AComponent),' Name=',PropInfo^.Name,' Type=',PropInfo^.PropType^.Name,' Value=',dbgsName(ReferenceComponent),' TypeInfo=',TypeInfo^.Name);
if ReferenceComponent=SubComponent then begin