codetools: fixed class compltion for indexed property, patch #18416

git-svn-id: trunk@28877 -
This commit is contained in:
mattias 2011-01-06 17:22:04 +00:00
parent e2a2b1c57f
commit 2a79108848

View File

@ -5353,10 +5353,10 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
AccessParam); AccessParam);
end else begin end else begin
// 'read' keyword does not exist -> insert behind index and type // 'read' keyword does not exist -> insert behind index and type
if Parts[ppIndexWord].StartPos>0 then if Parts[ppIndex].StartPos>0 then
InsertPos:=Parts[ppIndexWord].EndPos
else if Parts[ppIndex].StartPos>0 then
InsertPos:=Parts[ppIndex].EndPos InsertPos:=Parts[ppIndex].EndPos
else if Parts[ppIndexWord].StartPos>0 then
InsertPos:=Parts[ppIndexWord].EndPos
else else
InsertPos:=Parts[ppType].EndPos; InsertPos:=Parts[ppType].EndPos;
ASourceChangeCache.Replace(gtSpace,gtNone,InsertPos,InsertPos, ASourceChangeCache.Replace(gtSpace,gtNone,InsertPos,InsertPos,
@ -5378,7 +5378,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
CleanAccessFunc:=UpperCaseStr(AccessParam)+'('+CleanParamList+');'; CleanAccessFunc:=UpperCaseStr(AccessParam)+'('+CleanParamList+');';
end else begin end else begin
// index + param list // index + param list
CleanAccessFunc:=UpperCaseStr(AccessParam)+'(:INTEGER;' CleanAccessFunc:=UpperCaseStr(AccessParam)+'(INTEGER;'
+CleanParamList+');'; +CleanParamList+');';
end; end;
end else begin end else begin
@ -5387,7 +5387,7 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
CleanAccessFunc:=UpperCaseStr(AccessParam)+';'; CleanAccessFunc:=UpperCaseStr(AccessParam)+';';
end else begin end else begin
// index, no param list // index, no param list
CleanAccessFunc:=UpperCaseStr(AccessParam)+'(:INTEGER);'; CleanAccessFunc:=UpperCaseStr(AccessParam)+'(INTEGER);';
end; end;
end; end;
if ProcExistsInCodeCompleteClass(CleanAccessFunc) then exit; if ProcExistsInCodeCompleteClass(CleanAccessFunc) then exit;
@ -5484,10 +5484,10 @@ var AccessParam, AccessParamPrefix, CleanAccessFunc, AccessFunc,
InsertPos:=Parts[ppRead].EndPos InsertPos:=Parts[ppRead].EndPos
else if Parts[ppReadWord].StartPos>0 then else if Parts[ppReadWord].StartPos>0 then
InsertPos:=Parts[ppReadWord].EndPos InsertPos:=Parts[ppReadWord].EndPos
else if Parts[ppIndexWord].StartPos>0 then
InsertPos:=Parts[ppIndexWord].EndPos
else if Parts[ppIndex].StartPos>0 then else if Parts[ppIndex].StartPos>0 then
InsertPos:=Parts[ppIndex].EndPos InsertPos:=Parts[ppIndex].EndPos
else if Parts[ppIndexWord].StartPos>0 then
InsertPos:=Parts[ppIndexWord].EndPos
else else
InsertPos:=Parts[ppType].EndPos; InsertPos:=Parts[ppType].EndPos;
ASourceChangeCache.Replace(gtSpace,gtNone,InsertPos,InsertPos, ASourceChangeCache.Replace(gtSpace,gtNone,InsertPos,InsertPos,