mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 08:40:24 +02:00
IdeIntf: Create default event handlers without assertion failure. Issue #30027.
git-svn-id: trunk@52212 -
This commit is contained in:
parent
14e5168217
commit
6060f5b9ab
@ -1358,7 +1358,7 @@ type
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
// persistent objects
|
||||
function GetObject(const aName: ShortString): TPersistent;
|
||||
function GetObjectName(Instance: TPersistent; AOwnerCompName: String): String;
|
||||
function GetObjectName(Instance: TPersistent; AOwnerComp: TComponent): String;
|
||||
procedure GetObjectNames(TypeData: PTypeData; const Proc: TGetStrProc);
|
||||
procedure ObjectReferenceChanged(Sender: TObject; NewObject: TPersistent);
|
||||
// modifing
|
||||
@ -4390,15 +4390,10 @@ begin
|
||||
else
|
||||
Result := ClassNameToComponentName(PropertyHook.GetRootClassName);
|
||||
end
|
||||
else begin
|
||||
Assert(Assigned(FOwnerComponent),
|
||||
'TMethodPropertyEditor.GetFormMethodName: FOwnerComponent not assigned.');
|
||||
Result := TrimNonAscii(PropertyHook.GetObjectName(GetComponent(0), FOwnerComponent.Name));
|
||||
end;
|
||||
if Result = '' then begin
|
||||
{raise EPropertyError.CreateRes(@SCannotCreateName);}
|
||||
else
|
||||
Result := TrimNonAscii(PropertyHook.GetObjectName(GetComponent(0), FOwnerComponent));
|
||||
if Result = '' then
|
||||
exit;
|
||||
end;
|
||||
Result := Result + GetTrimmedEventName;
|
||||
end;
|
||||
|
||||
@ -6088,7 +6083,7 @@ begin
|
||||
end;
|
||||
|
||||
function TPropertyEditorHook.GetObjectName(Instance: TPersistent;
|
||||
AOwnerCompName: String): String;
|
||||
AOwnerComp: TComponent): String;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
@ -6102,8 +6097,10 @@ begin
|
||||
Result:=TComponent(Instance).Name
|
||||
else if instance is TCollectionItem then
|
||||
Result:=TCollectionItem(Instance).GetNamePath
|
||||
else
|
||||
Result:=AOwnerCompName + ClassNameToComponentName(Instance.ClassName);
|
||||
else begin
|
||||
Assert(Assigned(AOwnerComp),'TPropertyEditorHook.GetObjectName: AOwnerComp not assigned.');
|
||||
Result:=AOwnerComp.Name + ClassNameToComponentName(Instance.ClassName);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPropertyEditorHook.GetObjectNames(TypeData: PTypeData;
|
||||
|
Loading…
Reference in New Issue
Block a user