lcl: minor changes for GetDesignerForm

git-svn-id: trunk@22818 -
This commit is contained in:
paul 2009-11-27 04:17:43 +00:00
parent 3a13c17161
commit ce5d8e99d8

View File

@ -1723,14 +1723,17 @@ function GetDesignerForm(AComponent: TComponent): TCustomForm;
var
OwnerComponent: TComponent;
begin
Result:=nil;
if AComponent=nil then exit;
if AComponent = nil then Exit(nil);
if Assigned(OnGetDesignerForm) then
Result:=OnGetDesignerForm(AComponent)
else begin
OwnerComponent:=AComponent;
while OwnerComponent.Owner<>nil do OwnerComponent:=OwnerComponent.Owner;
if OwnerComponent is TCustomForm then Result:=TCustomForm(OwnerComponent);
Result := OnGetDesignerForm(AComponent)
else
begin
Result := nil;
OwnerComponent := AComponent;
while OwnerComponent.Owner <> nil do
OwnerComponent := OwnerComponent.Owner;
if OwnerComponent is TCustomForm then
Result := TCustomForm(OwnerComponent);
end;
end;