Designer: Simplify DoDeletePersistent.

git-svn-id: trunk@56930 -
This commit is contained in:
juha 2018-01-03 09:56:41 +00:00
parent 1d105883fa
commit 241124c159

View File

@ -2977,22 +2977,18 @@ end;
procedure TDesigner.DoDeletePersistent(APersistent: TPersistent; FreeIt: boolean);
var
Hook: TPropertyEditorHook;
AComponent: TComponent;
AForm: TCustomForm;
begin
if APersistent=nil then exit;
try
//debugln(['TDesigner.DoDeletePersistent A ',dbgsName(APersistent),' FreeIt=',FreeIt]);
// unselect component
Selection.Remove(APersistent);
if (APersistent is TComponent) then begin
if APersistent is TComponent then begin
PopupMenuComponentEditor:=nil;
AComponent:=TComponent(APersistent);
if csDestroying in AComponent.ComponentState then
if csDestroying in TComponent(APersistent).ComponentState then
FreeIt:=false;
end;
AForm:=GetDesignerForm(APersistent);
if AForm=nil then begin
if GetDesignerForm(APersistent)=nil then begin
// has no designer
// -> do not call handlers and simply get rid of the rubbish
if FreeIt then begin