Codetools: Fix FindDeclaration tool to not finds inaccessible private/protected fields. Issue #22464, patch from Anton

git-svn-id: trunk@40909 -
This commit is contained in:
juha 2013-04-28 15:20:16 +00:00
parent 3cad2a3828
commit 727f6ddd62

View File

@ -8746,8 +8746,7 @@ begin
Params.FoundProc^.ExprInputList.Count) then Params.FoundProc^.ExprInputList.Count) then
begin begin
// the new proc fits better // the new proc fits better
Params.ChangeFoundProc(FoundContext,ParamCompatibility, Params.ChangeFoundProc(FoundContext,ParamCompatibility,CurCompatibilityList);
CurCompatibilityList);
CurCompatibilityList:=nil; // set to nil, so that it will not be freed CurCompatibilityList:=nil; // set to nil, so that it will not be freed
end; end;
end; end;
@ -8758,6 +8757,14 @@ begin
FreeMem(CurCompatibilityList); FreeMem(CurCompatibilityList);
end; end;
end; end;
end else
if (FoundContext.Node.Desc=ctnVarDefinition) then begin
if not (fdfIgnoreClassVisibility in Params.Flags)
and (FoundContext.Tool<>Params.IdentifierTool)
and (GetClassVisibility(FoundContext.Node)=ctnClassPrivate) then
Result:=ifrProceedSearch
else
Result:=ifrSuccess;
end else begin end else begin
Result:=ifrSuccess; Result:=ifrSuccess;
end; end;