Fixws_helper code generation : Qualified interface name in proxy code(Thanks mcarro)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4066 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2015-03-25 17:27:45 +00:00
parent 8f4b0570a8
commit cdcc835400

View File

@ -248,7 +248,7 @@ function DeduceEasyInterfaceForDocStyle(
Exit; Exit;
if not IsFinallyAClassType(locElt) then if not IsFinallyAClassType(locElt) then
Exit; Exit;
locRawInParam := TPasClassType(locElt); locRawInParam := TPasClassType(GetUltimeType(TPasType(locElt)));
locIsFunction := False; locIsFunction := False;
if AMethod.InheritsFrom(TPasFunction) then begin if AMethod.InheritsFrom(TPasFunction) then begin
locElt := TPasFunctionType(AMethod.ProcType).ResultEl.ResultType; locElt := TPasFunctionType(AMethod.ProcType).ResultEl.ResultType;
@ -256,7 +256,7 @@ function DeduceEasyInterfaceForDocStyle(
locElt := AContainer.FindElement(locElt.Name); locElt := AContainer.FindElement(locElt.Name);
if not IsFinallyAClassType(locElt) then if not IsFinallyAClassType(locElt) then
Exit; Exit;
locRawOutParam := TPasClassType(locElt); locRawOutParam := TPasClassType(GetUltimeType(TPasType(locElt)));
q := locRawOutParam.Members.Count; q := locRawOutParam.Members.Count;
if ( q > 0 ) then begin if ( q > 0 ) then begin
for k := 0 to ( q - 1 ) do begin for k := 0 to ( q - 1 ) do begin
@ -486,11 +486,20 @@ var
HandleEasyIntf : boolean; HandleEasyIntf : boolean;
procedure WriteDec(); procedure WriteDec();
var
locModule : TPasModule;
begin begin
locModule := FindModule(AIntf);
if (locModule = nil) then
locModule := FSymbolTable.CurrentModule;
Indent(); Indent();
Write('%s=class(%s,%s',[GenerateClassName(AIntf),sPROXY_BASE_CLASS,AIntf.Name]); Write('%s=class(%s,%s.%s',[GenerateClassName(AIntf),sPROXY_BASE_CLASS, locModule.Name, AIntf.Name]);
if HandleEasyIntf then if HandleEasyIntf then begin
Write(',%s',[AEasyIntf.Name]); locModule := FindModule(AIntf);
if (locModule = nil) then
locModule := FSymbolTable.CurrentModule;
Write(',%s.%s',[locModule.Name, AEasyIntf.Name]);
end;
WriteLn(')'); WriteLn(')');
FDecProcStream.IncIndent(); FDecProcStream.IncIndent();
try try
@ -801,6 +810,7 @@ Var
elt : TPasElement; elt : TPasElement;
objArgs : Boolean; objArgs : Boolean;
localIsFunc : boolean; localIsFunc : boolean;
origineResultType : TPasClassType;
begin begin
origineMthd := FindMember(AIntf,AMthd.Name) as TPasProcedure; origineMthd := FindMember(AIntf,AMthd.Name) as TPasProcedure;
Assert ( origineMthd <> nil ); Assert ( origineMthd <> nil );
@ -810,8 +820,9 @@ Var
localIsFunc := AMthd.InheritsFrom(TPasFunction); localIsFunc := AMthd.InheritsFrom(TPasFunction);
if origineIsFunc then begin if origineIsFunc then begin
origineRes := TPasFunctionType(origineMthd.ProcType).ResultEl; origineRes := TPasFunctionType(origineMthd.ProcType).ResultEl;
for k := 0 to ( TPasClassType(origineRes.ResultType).Members.Count - 1 ) do begin origineResultType := GetUltimeType(TPasType(origineRes.ResultType)) as TPasClassType;
elt := TPasElement(TPasClassType(origineRes.ResultType).Members[k]); for k := 0 to (origineResultType.Members.Count - 1) do begin
elt := TPasElement(origineResultType.Members[k]);
if elt.InheritsFrom(TPasProperty) and ( TPasProperty(elt).Visibility = visPublished ) then begin if elt.InheritsFrom(TPasProperty) and ( TPasProperty(elt).Visibility = visPublished ) then begin
origineResProp := TPasProperty(elt); origineResProp := TPasProperty(elt);
Break; Break;
@ -985,12 +996,17 @@ Var
end; end;
procedure WriteTypeInfoMethod(); procedure WriteTypeInfoMethod();
var
locModule : TPasModule;
begin begin
locModule := FindModule(AIntf);
if (locModule = nil) then
locModule := FSymbolTable.CurrentModule;
NewLine(); NewLine();
WriteLn('class function %s.GetServiceType() : PTypeInfo;',[strClassName]); WriteLn('class function %s.GetServiceType() : PTypeInfo;',[strClassName]);
WriteLn('begin'); WriteLn('begin');
IncIndent(); IncIndent();
Indent(); WriteLn('result := TypeInfo(%s);',[AIntf.Name]); Indent(); WriteLn('result := TypeInfo(%s.%s);',[locModule.Name, AIntf.Name]);
DecIndent(); DecIndent();
WriteLn('end;'); WriteLn('end;');
NewLine(); NewLine();
@ -2891,7 +2907,7 @@ procedure TInftGenerator.GenerateCustomMetadatas();
pl := SymbolTable.Properties.FindList(AOp); pl := SymbolTable.Properties.FindList(AOp);
if ( pl <> nil ) then begin if ( pl <> nil ) then begin
for k := 0 to Pred(pl.Count) do begin for k := 0 to Pred(pl.Count) do begin
if not IsStrEmpty(pl.ValueFromIndex[k]) then begin //if not IsStrEmpty(pl.ValueFromIndex[k]) then begin
Indent();WriteLn('mm.SetOperationCustomData('); Indent();WriteLn('mm.SetOperationCustomData(');
IncIndent(); IncIndent();
Indent(); WriteLn('%s,',[sUNIT_NAME]); Indent(); WriteLn('%s,',[sUNIT_NAME]);
@ -2901,7 +2917,7 @@ procedure TInftGenerator.GenerateCustomMetadatas();
Indent(); WriteLn('%s' ,[QuotedStr(pl.ValueFromIndex[k])]); Indent(); WriteLn('%s' ,[QuotedStr(pl.ValueFromIndex[k])]);
DecIndent(); DecIndent();
Indent();WriteLn(');'); Indent();WriteLn(');');
end; //end;
end; end;
end; end;
end; end;