IDE: Allow adding CollectionItems again via OI tree's context menu. Issue #38239.

git-svn-id: trunk@64263 -
This commit is contained in:
juha 2020-12-22 09:07:43 +00:00
parent 573d742f51
commit 9c3791702a

View File

@ -13306,9 +13306,8 @@ var
ComponentClasses: TClassList;
begin
//DebugLn('Hint: (lazarus) TMainIDE.PropHookPersistentAdded A ',dbgsName(APersistent));
Assert(APersistent is TComponent, 'TMainIDE.PropHookPersistentAdded: Not a TComponent.');
//if APersistent is TComponent then
//begin
if APersistent is TComponent then
begin
AComponent:=TComponent(APersistent);
if (IDEComponentPalette.FindRegComponent(AComponent.ClassType)=nil)
and (Project1.UnitWithComponentClass(TComponentClass(AComponent.ClassType))=nil) then
@ -13343,12 +13342,10 @@ begin
// Note: Source editor will be updated with added components later on Idle
// using FComponentAddedDesigner and FComponentAddedUnit.
end
else begin
FComponentAddedDesigner:= Nil;
exit;
else
FComponentAddedDesigner:=Nil;
end;
end;
//end;
// select persistent
if Select then
TheControlSelection.AssignPersistent(APersistent);