mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 20:40:40 +02:00
lcl: minor changes for GetDesignerForm
git-svn-id: trunk@22818 -
This commit is contained in:
parent
3a13c17161
commit
ce5d8e99d8
17
lcl/forms.pp
17
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user