mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 22:20:24 +02:00
parent
560c617ebf
commit
710f2aa2d1
18
ide/main.pp
18
ide/main.pp
@ -392,7 +392,7 @@ type
|
||||
procedure OIOnFindDeclarationOfProperty(Sender: TObject);
|
||||
procedure OIOnUpdateRestricted(Sender: TObject);
|
||||
function OnPropHookGetMethodName(const Method: TMethod;
|
||||
CheckOwner: TObject): String;
|
||||
PropOwner: TObject): String;
|
||||
procedure OnPropHookGetMethods(TypeData: PTypeData; Proc:TGetStringProc);
|
||||
function OnPropHookMethodExists(const AMethodName: String;
|
||||
TypeData: PTypeData;
|
||||
@ -1386,27 +1386,23 @@ begin
|
||||
end;
|
||||
|
||||
function TMainIDE.OnPropHookGetMethodName(const Method: TMethod;
|
||||
CheckOwner: TObject): String;
|
||||
PropOwner: TObject): String;
|
||||
var
|
||||
JITMethod: TJITMethod;
|
||||
LookupRoot: TPersistent;
|
||||
begin
|
||||
if Method.Code<>nil then begin
|
||||
if Method.Data<>nil then begin
|
||||
if (CheckOwner<>nil) and (TObject(Method.Data)<>CheckOwner) then
|
||||
Result:=''
|
||||
else begin
|
||||
Result:=TObject(Method.Data).MethodName(Method.Code);
|
||||
if Result='' then
|
||||
Result:='<Unpublished>';
|
||||
end;
|
||||
Result:=TObject(Method.Data).MethodName(Method.Code);
|
||||
if Result='' then
|
||||
Result:='<Unpublished>';
|
||||
end else
|
||||
Result:='<No LookupRoot>';
|
||||
end else if IsJITMethod(Method) then begin
|
||||
JITMethod:=TJITMethod(Method.Data);
|
||||
Result:=JITMethod.TheMethodName;
|
||||
if CheckOwner is TComponent then begin
|
||||
LookupRoot:=GetLookupRootForComponent(TComponent(CheckOwner));
|
||||
if PropOwner is TComponent then begin
|
||||
LookupRoot:=GetLookupRootForComponent(TComponent(PropOwner));
|
||||
if LookupRoot is TComponent then begin
|
||||
//DebugLn(['TMainIDE.OnPropHookGetMethodName ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]);
|
||||
if (LookupRoot.ClassType<>JITMethod.TheClass) then begin
|
||||
|
@ -1241,7 +1241,7 @@ type
|
||||
function CreateMethod(const Name: ShortString; ATypeInfo:PTypeInfo;
|
||||
APersistent: TPersistent;
|
||||
const APropertyPath: string): TMethod;
|
||||
function GetMethodName(const Method: TMethod; CheckOwner: TObject): String;
|
||||
function GetMethodName(const Method: TMethod; PropOwner: TObject): String;
|
||||
procedure GetMethods(TypeData: PTypeData; Proc: TGetStringProc);
|
||||
function MethodExists(const Name: String; TypeData: PTypeData;
|
||||
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean):boolean;
|
||||
@ -5432,24 +5432,20 @@ begin
|
||||
end;
|
||||
|
||||
function TPropertyEditorHook.GetMethodName(const Method: TMethod;
|
||||
CheckOwner: TObject): String;
|
||||
PropOwner: TObject): String;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i:=GetHandlerCount(htGetMethodName);
|
||||
if GetNextHandlerIndex(htGetMethodName,i) then begin
|
||||
Result:=TPropHookGetMethodName(FHandlers[htGetMethodName][i])(Method,CheckOwner);
|
||||
Result:=TPropHookGetMethodName(FHandlers[htGetMethodName][i])(Method,PropOwner);
|
||||
end else begin
|
||||
// search the method name with the given code pointer
|
||||
if Assigned(Method.Code) then begin
|
||||
if Method.Data<>nil then begin
|
||||
if (CheckOwner<>nil) and (TObject(Method.Data)<>CheckOwner) then
|
||||
Result:=''
|
||||
else begin
|
||||
Result:=TObject(Method.Data).MethodName(Method.Code);
|
||||
if Result='' then
|
||||
Result:='<Unpublished>';
|
||||
end;
|
||||
Result:=TObject(Method.Data).MethodName(Method.Code);
|
||||
if Result='' then
|
||||
Result:='<Unpublished>';
|
||||
end else
|
||||
Result:='<No LookupRoot>';
|
||||
end else
|
||||
|
Loading…
Reference in New Issue
Block a user