From ce5d8e99d8812ddfea452930f9d59e788ac4aa73 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 27 Nov 2009 04:17:43 +0000 Subject: [PATCH] lcl: minor changes for GetDesignerForm git-svn-id: trunk@22818 - --- lcl/forms.pp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lcl/forms.pp b/lcl/forms.pp index cb3e3e25db..7de1d9c321 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -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;