IDE: fixed creating methods with the right LookupRoot owner for inline components

git-svn-id: trunk@15700 -
This commit is contained in:
mattias 2008-07-07 22:21:48 +00:00
parent bc8c1dea0f
commit 138ad73ec6
2 changed files with 9 additions and 3 deletions

View File

@ -1648,7 +1648,7 @@ begin
Method.Data := FCurReadJITComponent;
end else begin
// create a fake TJITMethod
JITMethod:=JITMethods.Add(FCurReadJITComponent.ClassType,TheMethodName);
JITMethod:=JITMethods.Add(Reader.LookupRoot.ClassType,TheMethodName);
Method:=JITMethod.Method;
end;
SetMethodProp(Instance, PropInfo, Method);
@ -1842,7 +1842,7 @@ function TJITMethods.Add(aClass: TClass;
begin
Result:=Find(aClass,aMethodName);
if Result=nil then begin
//DebugLn(['TJITMethods.Add Create Class=',dbgsname(aClass),' aMethodName=',aMethodName]);
DebugLn(['TJITMethods.Add Create Class=',dbgsname(aClass),' aMethodName=',aMethodName]);
Result:=TJITMethod.Create(Self,aClass,aMethodName);
end;
end;

View File

@ -1413,6 +1413,8 @@ end;
function TMainIDE.OnPropHookGetMethodName(const Method: TMethod;
CheckOwner: TObject): ShortString;
var
JITMethod: TJITMethod;
begin
if Method.Code<>nil then begin
if Method.Data<>nil then begin
@ -1426,7 +1428,11 @@ begin
end else
Result:='<No LookupRoot>';
end else if IsJITMethod(Method) then begin
Result:=TJITMethod(Method.Data).TheMethodName;
JITMethod:=TJITMethod(Method.Data);
Result:=JITMethod.TheMethodName;
if GlobalDesignHook.LookupRoot.ClassType<>JITMethod.TheClass then begin
Result:=JITMethod.TheClass.ClassName+'.'+Result;
end;
end else
Result:='';
end;