codetools: RenameSourceNameReferences: apply ascending

This commit is contained in:
mattias 2025-02-10 14:43:48 +01:00
parent 6552d52af2
commit b042ec4560

View File

@ -1335,7 +1335,7 @@ begin
{$ENDIF}
if (Refs.TreeOfPCodeXYPosition<>nil) and (Refs.TreeOfPCodeXYPosition.Count>0) then begin
InitReplaceDottedIdentifier(Refs.LocalSrcName,Refs.NewLocalSrcName,Param);
Node:=Refs.TreeOfPCodeXYPosition.FindLowest;
Node:=Refs.TreeOfPCodeXYPosition.FindHighest;
while Node<>nil do begin
CodeXYPos:=PCodeXYPosition(Node.Data);
//debugln(['TChangeDeclarationTool.RenameSourceNameReferences ',dbgs(CodeXYPos^)]);
@ -1344,7 +1344,7 @@ begin
end else begin
ReplaceDottedIdentifier(p,Param,SourceChanger);
end;
Node:=Refs.TreeOfPCodeXYPosition.FindSuccessor(Node);
Node:=Refs.TreeOfPCodeXYPosition.FindPrecessor(Node);
end;
end;