codetools: property completion: fixed read/write accessor for param+index specifier

git-svn-id: trunk@55917 -
This commit is contained in:
mattias 2017-09-24 17:58:26 +00:00
parent dd43ceac8e
commit 0e777d6648

View File

@ -7243,8 +7243,6 @@ var
AccessParam:=copy(Src,Parts[ppRead].StartPos, AccessParam:=copy(Src,Parts[ppRead].StartPos,
Parts[ppRead].EndPos-Parts[ppRead].StartPos) Parts[ppRead].EndPos-Parts[ppRead].StartPos)
else begin else begin
AccessParam:=''; // This was missing
// ToDo: Fix this test. AccessParam is now empty.
if (Parts[ppParamList].StartPos>0) or (Parts[ppIndexWord].StartPos>0) if (Parts[ppParamList].StartPos>0) or (Parts[ppIndexWord].StartPos>0)
or (SysUtils.CompareText(AccessParamPrefix, or (SysUtils.CompareText(AccessParamPrefix,
LeftStr(AccessParam,length(AccessParamPrefix)))=0) LeftStr(AccessParam,length(AccessParamPrefix)))=0)
@ -7299,9 +7297,8 @@ var
end else begin end else begin
// ToDo: find out type of index // ToDo: find out type of index
if (Parts[ppParamList].StartPos>0) then begin if (Parts[ppParamList].StartPos>0) then begin
// index + param list // param list + index
CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+';') CleanAccessFunc:=UpperCaseStr(AccessParam+'('+CleanParamList+';'+IndexType+');');
+CleanParamList+');';
end else begin end else begin
// index, no param list // index, no param list
CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+');'); CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+');');
@ -7341,9 +7338,9 @@ var
AccessFunc:='function '+AccessParam AccessFunc:='function '+AccessParam
+'('+ParamList+'):'+PropType+';'; +'('+ParamList+'):'+PropType+';';
end else begin end else begin
// index + param list // param list + index
AccessFunc:='function '+AccessParam AccessFunc:='function '+AccessParam
+'(AIndex:'+IndexType+';'+ParamList+'):'+PropType+';'; +'('+ParamList+'; AIndex:'+IndexType+'):'+PropType+';';
end; end;
end else begin end else begin
if (Parts[ppIndexWord].StartPos<1) then begin if (Parts[ppIndexWord].StartPos<1) then begin
@ -7432,9 +7429,8 @@ var
end else begin end else begin
// ToDo: find out index type // ToDo: find out index type
if (Parts[ppParamList].StartPos>0) then begin if (Parts[ppParamList].StartPos>0) then begin
// index + param list // param list + index
CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+';' CleanAccessFunc:=UpperCaseStr(AccessParam+'('+CleanParamList+';'+IndexType+';'+PropType+');');
+CleanParamList+';'+PropType+');');
end else begin end else begin
// index, no param list // index, no param list
CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+';'+PropType+');'); CleanAccessFunc:=UpperCaseStr(AccessParam+'('+IndexType+';'+PropType+');');
@ -7481,9 +7477,9 @@ var
+'('+ParamList+';'+AccessVariableNameParam+':' +'('+ParamList+';'+AccessVariableNameParam+':'
+PropType+');'; +PropType+');';
end else begin end else begin
// index + param list // param list+ index
AccessFunc:='procedure '+AccessParam AccessFunc:='procedure '+AccessParam
+'(AIndex:'+IndexType+';'+ParamList+';' +'('+ParamList+';AIndex:'+IndexType+';'
+AccessVariableNameParam+':'+PropType+');'; +AccessVariableNameParam+':'+PropType+');';
end; end;
end else begin end else begin
@ -7603,7 +7599,7 @@ var
AccessFunc := 'function ' + AccessParam + '(AIndex:'+IndexType+'):Boolean;'; AccessFunc := 'function ' + AccessParam + '(AIndex:'+IndexType+'):Boolean;';
CleanAccessFunc := UpperCaseStr(CleanAccessFunc + '('+IndexType+');'); CleanAccessFunc := UpperCaseStr(CleanAccessFunc + '('+IndexType+');');
if IsClassProp then if IsClassProp then
AccessFunc:='class '+AccessFunc+' static;';; AccessFunc:='class '+AccessFunc+' static;';
// add new Insert Node // add new Insert Node
if CompleteProperties then if CompleteProperties then
AddClassInsertion(CleanAccessFunc,AccessFunc,AccessParam, AddClassInsertion(CleanAccessFunc,AccessFunc,AccessParam,