LCL: One more sanity check for a new Notebook page name. Issue #36957.

This commit is contained in:
Juha 2025-03-08 00:29:16 +02:00
parent adf11362e1
commit fa2ad4f983

View File

@ -17,8 +17,9 @@ function CreateUniquePageName(BaseName: string; OwnerComp: TComponent): string;
var var
i, j: integer; i, j: integer;
begin begin
i:=0;
Result:=BaseName; Result:=BaseName;
if (OwnerComp=nil) or (Result='') then exit;
i:=0;
while true do begin while true do begin
j:=OwnerComp.ComponentCount-1; j:=OwnerComp.ComponentCount-1;
while (j>=0) and (CompareText(Result,OwnerComp.Components[j].Name)<>0) do while (j>=0) and (CompareText(Result,OwnerComp.Components[j].Name)<>0) do