codetools: property completion: do not add const in setter

git-svn-id: trunk@31698 -
This commit is contained in:
mattias 2011-07-14 09:17:18 +00:00
parent e2bd12f9d6
commit c82d807457

View File

@ -6211,20 +6211,20 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
if (Parts[ppIndexWord].StartPos<1) then begin
// param list, no index
AccessFunc:='procedure '+AccessParam
+'('+ParamList+';const '+SetPropertyVariablename+': '
+'('+ParamList+';'+SetPropertyVariablename+':'
+PropType+');';
end else begin
// index + param list
AccessFunc:='procedure '+AccessParam
+'(AIndex:integer;'+ParamList+';'
+'const '+SetPropertyVariablename+': '+PropType+');';
+SetPropertyVariablename+':'+PropType+');';
end;
end else begin
if (Parts[ppIndexWord].StartPos<1) then begin
// no param list, no index
AccessFunc:=
'procedure '+AccessParam
+'(const '+SetPropertyVariablename+': '+PropType+');';
+'('+SetPropertyVariablename+':'+PropType+');';
if VariableName<>'' then begin
{ read spec is a variable -> add simple assign code to body
For example:
@ -6239,7 +6239,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
ProcBody:=
'procedure '
+ExtractClassName(PropNode.Parent.Parent,false)+'.'+AccessParam
+'(const '+SetPropertyVariablename+': '+PropType+');'
+'('+SetPropertyVariablename+':'+PropType+');'
+BeautifyCodeOpts.LineEnd
+'begin'+BeautifyCodeOpts.LineEnd
+GetIndentStr(BeautifyCodeOpts.Indent)
@ -6253,8 +6253,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
end else begin
// index, no param list
AccessFunc:='procedure '+AccessParam
+'(AIndex:integer; const '+SetPropertyVariablename+': '
+PropType+');';
+'(AIndex:integer;'+SetPropertyVariablename+':'+PropType+');';
end;
end;
// add new Insert Node