IDE: Fix ComponentList adding comp with [Ctrl+Enter] on an empty form. Issue #40245, patch by n7800.

This commit is contained in:
Juha 2023-05-09 11:24:50 +03:00
parent 2d059ffef4
commit e36a1b4633

View File

@ -281,9 +281,15 @@ begin
NewParent := GetSelectedDesignComponent;
// get parent component of neighboring component
if AAddNeighboring then
if NewParent.HasParent then
NewParent := NewParent.GetParentComponent;
if AAddNeighboring and assigned(NewParent) then
begin
if (not (NewParent is TCustomForm)) and
(not (NewParent is TCustomFrame)) then
begin
if NewParent.HasParent then
NewParent := NewParent.GetParentComponent;
end;
end;
if NewParent = nil then
Exit;