mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 07:59:35 +02:00
LCL: in TRadioGroup and TCheckGroup don't set the name for runtime created radiobuttons/checkboxes.
They are not needed and can give rise to unexpected crashes if the name already exists.
This commit is contained in:
parent
5137735655
commit
d405afa039
@ -249,10 +249,7 @@ begin
|
||||
for i:=0 to FItems.Count-1 do begin
|
||||
CheckBox:=TCheckBox(FButtonList[i]);
|
||||
CheckBox.Caption:=FItems[i];
|
||||
CheckBox.Name := '';
|
||||
end;
|
||||
for i:=0 to FButtonList.Count-1 do
|
||||
TCheckBox(FButtonList[i]).Name:='CheckBox'+IntToStr(i);
|
||||
finally
|
||||
FUpdatingItems:=false;
|
||||
end;
|
||||
@ -426,7 +423,6 @@ begin
|
||||
if (Idx <> -1) and (Idx < Items.Count) then
|
||||
begin
|
||||
FButtonList.Delete(Idx);
|
||||
AComponent.Name := ''; //otherwise we get duplicate name error in UpdateItems
|
||||
Items.Delete(Idx);
|
||||
end;
|
||||
end;
|
||||
|
@ -228,10 +228,7 @@ begin
|
||||
ARadioButton := TRadioButton(FButtonList[i]);
|
||||
ARadioButton.Checked := (i = FItemIndex);
|
||||
ARadioButton.Visible := true;
|
||||
ARadioButton.Name := '';
|
||||
end;
|
||||
for i:=0 to FButtonList.Count-1 do
|
||||
TRadioButton(FButtonList[i]).Name:='RadioButton'+IntToStr(i);
|
||||
|
||||
//FHiddenButton must remain the last item in Controls[], so that Controls[] is in sync with Items[]
|
||||
Self.RemoveControl(FHiddenButton);
|
||||
@ -479,7 +476,6 @@ begin
|
||||
if (Idx <> -1) and (Idx < Items.Count) then
|
||||
begin
|
||||
FButtonList.Delete(Idx);
|
||||
AComponent.Name := '';
|
||||
Items.Delete(Idx);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user