IDE: searching jitmethods in ancestors

git-svn-id: trunk@17754 -
This commit is contained in:
mattias 2008-12-09 12:02:16 +00:00
parent bd1b6382f0
commit 5f7325271c
2 changed files with 11 additions and 4 deletions

View File

@ -1642,14 +1642,21 @@ var
{$ENDIF}
begin
{$IFNDEF DisableFakeMethods}
//debugln('TJITComponentList.ReaderSetMethodProperty ',DbgSName(Instance),' ',PropInfo^.Name,':=',TheMethodName);
//debugln('TJITComponentList.ReaderSetMethodProperty ',DbgSName(Instance),' LookupRoot=',DbgSName(Reader.LookupRoot),' ',PropInfo^.Name,':=',TheMethodName);
Method.Code:=FCurReadJITComponent.MethodAddress(TheMethodName);
if Method.Code<>nil then begin
// there is a real method with this name
Method.Data := FCurReadJITComponent;
end else begin
// create a fake TJITMethod
JITMethod:=JITMethods.Add(Reader.LookupRoot.ClassType,TheMethodName);
JITMethod:=nil;
if FCurReadStreamClass<>nil then begin
// search in JIT method of stream class (e.g. ancestor)
JITMethod:=JITMethods.Find(FCurReadStreamClass,TheMethodName);
end;
if JITMethod=nil then begin
// create a fake TJITMethod
JITMethod:=JITMethods.Add(Reader.LookupRoot.ClassType,TheMethodName);
end;
Method:=JITMethod.Method;
end;
SetMethodProp(Instance, PropInfo, Method);

View File

@ -1483,7 +1483,7 @@ begin
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)]);
//DebugLn(['TMainIDE.OnPropHookGetMethodName ',Result,' ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]);
if (LookupRoot.ClassType<>JITMethod.TheClass) then begin
Result:=JITMethod.TheClass.ClassName+'.'+Result;
end;