Delete a component from Ancestor form causes IDE hangs in all inherited forms from this parent
Original Reporter info from Mantis: zgabrovski
-
Reporter name: Zdravko Gabrovski
Original Reporter info from Mantis: zgabrovski
- Reporter name: Zdravko Gabrovski
Description:
There is a project with a "Ancestor" form with some components - typically panel with "OK" and "Cancel" buttons and some other common thinks, such a title label.
There is one or more forms, that inherits Template form, created with "File->New->Inherited Project component".
When you delete a component in Ancestor form and after that try to open an inherited form and to show the form designer ,the IDE displays an error:
Stream=TfMain1: Root=:TfMain1
Component Class: TLabel
Ancestor class for "Label1" not found.
Stream position: 79
[Continue loading] [Cancel loading this resource] [Stop all loading]
And Hangs with AV Error.
The only way to solve the case is manualy open the .lfm of inherited form and delete the lines, that contain definition of missing components.
for examplle, if the deleted component is RadioGroup1, you must delete
inherited fMain1: TfMain1
inherited Panel2: TPanel
inherited RadioGroup1: TRadioGroup <---- You must delete this in all your forms
Left = 16 <---- that inherits from ancestor form
Top = 24 <----
end <-----
end
end
Steps to reproduce:
Create empty project with main form, called "form1" in "unit1.pas"
Put a simple Component (such a TLabel) called "Label1".
Save All your project somewhere.
Then, Choose File->New and select "Inherited Project component" in the left, and select "Form1" in "unit1.pas" from the right side.
It will create a Form2 which inheriths Form1 and Label1 should be on the screen, when you press F12 for a form designer.
Save all again your project, and close form2 from the editor.
Now, goto the form1, show form designer with F12, and delete Label1 component.
Now try to open form2 with form designer, and the IDE will display a mesasge for a missing Label1 from Ancestor form, and no mather what will be your chose, the IDE will hangs with AV.
Additional information:
Please find attached simple project with a two forms, just open it and delete label1 from then Ancestor form.
Mantis conversion info:
- Mantis ID: 36920
- OS: All
- OS Build: All
- Build: trunk
- Platform: All