codetools: AddUnitWarnDirective: fixed startnode

git-svn-id: branches/fixes_1_8@56074 -
This commit is contained in:
mattias 2017-10-16 11:36:05 +00:00
parent 577d46b3d1
commit 91e848b779

View File

@ -6578,7 +6578,19 @@ begin
end;
MaxPos:=0;
Node:=Tree.Root.NextBrother;
Node:=FindInterfaceNode;
if Node=nil then
Node:=FindMainUsesNode;
debugln(['TStandardCodeTool.AddUnitWarnDirective AAA1 ',Tree.Root.DescAsString]);
debugln(['TStandardCodeTool.AddUnitWarnDirective AAA2 ',Tree.Root.FirstChild.DescAsString]);
if Node=nil then begin
Node:=Tree.Root.FirstChild;
if (Node<>nil) and (Node.Desc=ctnSrcName) then begin
debugln(['TStandardCodeTool.AddUnitWarnDirective AA3 ',Node.DescAsString]);
Node:=Node.NextSkipChilds;
end;
end;
debugln(['TStandardCodeTool.AddUnitWarnDirective ',Node.DescAsString]);
if Node<>nil then
MaxPos:=Node.StartPos
else