mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-15 11:19:11 +02:00
codetools: property completion: do not add const in setter
git-svn-id: trunk@31698 -
This commit is contained in:
parent
e2bd12f9d6
commit
c82d807457
@ -6211,20 +6211,20 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
|
|||||||
if (Parts[ppIndexWord].StartPos<1) then begin
|
if (Parts[ppIndexWord].StartPos<1) then begin
|
||||||
// param list, no index
|
// param list, no index
|
||||||
AccessFunc:='procedure '+AccessParam
|
AccessFunc:='procedure '+AccessParam
|
||||||
+'('+ParamList+';const '+SetPropertyVariablename+': '
|
+'('+ParamList+';'+SetPropertyVariablename+':'
|
||||||
+PropType+');';
|
+PropType+');';
|
||||||
end else begin
|
end else begin
|
||||||
// index + param list
|
// index + param list
|
||||||
AccessFunc:='procedure '+AccessParam
|
AccessFunc:='procedure '+AccessParam
|
||||||
+'(AIndex:integer;'+ParamList+';'
|
+'(AIndex:integer;'+ParamList+';'
|
||||||
+'const '+SetPropertyVariablename+': '+PropType+');';
|
+SetPropertyVariablename+':'+PropType+');';
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
if (Parts[ppIndexWord].StartPos<1) then begin
|
if (Parts[ppIndexWord].StartPos<1) then begin
|
||||||
// no param list, no index
|
// no param list, no index
|
||||||
AccessFunc:=
|
AccessFunc:=
|
||||||
'procedure '+AccessParam
|
'procedure '+AccessParam
|
||||||
+'(const '+SetPropertyVariablename+': '+PropType+');';
|
+'('+SetPropertyVariablename+':'+PropType+');';
|
||||||
if VariableName<>'' then begin
|
if VariableName<>'' then begin
|
||||||
{ read spec is a variable -> add simple assign code to body
|
{ read spec is a variable -> add simple assign code to body
|
||||||
For example:
|
For example:
|
||||||
@ -6239,7 +6239,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
|
|||||||
ProcBody:=
|
ProcBody:=
|
||||||
'procedure '
|
'procedure '
|
||||||
+ExtractClassName(PropNode.Parent.Parent,false)+'.'+AccessParam
|
+ExtractClassName(PropNode.Parent.Parent,false)+'.'+AccessParam
|
||||||
+'(const '+SetPropertyVariablename+': '+PropType+');'
|
+'('+SetPropertyVariablename+':'+PropType+');'
|
||||||
+BeautifyCodeOpts.LineEnd
|
+BeautifyCodeOpts.LineEnd
|
||||||
+'begin'+BeautifyCodeOpts.LineEnd
|
+'begin'+BeautifyCodeOpts.LineEnd
|
||||||
+GetIndentStr(BeautifyCodeOpts.Indent)
|
+GetIndentStr(BeautifyCodeOpts.Indent)
|
||||||
@ -6253,8 +6253,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
|
|||||||
end else begin
|
end else begin
|
||||||
// index, no param list
|
// index, no param list
|
||||||
AccessFunc:='procedure '+AccessParam
|
AccessFunc:='procedure '+AccessParam
|
||||||
+'(AIndex:integer; const '+SetPropertyVariablename+': '
|
+'(AIndex:integer;'+SetPropertyVariablename+':'+PropType+');';
|
||||||
+PropType+');';
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// add new Insert Node
|
// add new Insert Node
|
||||||
|
Loading…
Reference in New Issue
Block a user