Correct "easy access" proxy implementation.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1256 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2010-07-16 15:28:21 +00:00
parent af61b10bc5
commit 2e5b08e9d7

View File

@ -827,14 +827,18 @@ Var
if origineIsFunc then begin
Indent(); WriteLn('%s := %s(%s);',[sOUTPUT_PARAM,origineMthd.Name,sINPUT_PARAM]);
if localIsFunc then begin
Indent(); WriteLn('if ( %s <> nil ) then begin',[sOUTPUT_PARAM]);
IncIndent();
Indent(); WriteLn('Result := %s.%s;',[sOUTPUT_PARAM,origineResProp.Name]);
Indent(); WriteLn('%s.%s := nil;',[sOUTPUT_PARAM,origineResProp.Name]);
DecIndent();
elt := origineResProp.VarType;
if elt.InheritsFrom(TPasUnresolvedTypeRef) then
elt := SymbolTable.FindElement(SymbolTable.GetExternalName(elt));
Indent(); WriteLn('if ( %s <> nil ) then begin',[sOUTPUT_PARAM]);
IncIndent();
Indent(); WriteLn('Result := %s.%s;',[sOUTPUT_PARAM,origineResProp.Name]);
if SymbolTable.IsOfType(TPasType(elt),TPasClassType) or
SymbolTable.IsOfType(TPasType(elt),TPasArrayType)
then begin
Indent(); WriteLn('%s.%s := nil;',[sOUTPUT_PARAM,origineResProp.Name]);
end;
DecIndent();
Indent(); WriteLn('end else begin');
IncIndent();
if elt.InheritsFrom(TPasUnresolvedTypeRef) then begin