Refactoring the name or type of a Form does not change .lfm file
Original Reporter info from Mantis: dziesig
-
Reporter name: Don Ziesig
Original Reporter info from Mantis: dziesig
- Reporter name: Don Ziesig
Description:
I have encountered this bug back as far as Lazarus 1.2 on Linux Mint. Now have encountered the same on Raspbian and it still happens on 1.4.4.
Refactor | Rename Identifier (when identifier is a form name or type) misses the contents of the lfm file, the lfm file is not changed. Project compiles, but dies when code accesses a control on the form (the debugger shows the control's content as nil).
Switching the form to the lfm view shows the very first line still has the original Form name and/or form type. When this is edited and Run | Cleanup and Build is executed a usable exe file is created.
Steps to reproduce:
Create a project. Put a button on the form.
For the FormCreate event - in the handler do Button1.Caption := 'Something';
Run and verify the new Caption.
Back to the source code.
Select the form name and select Source | Refactor | Rename Identifier - Change the name of the form.
and/or
Select the form type and select Source | Refactor | Rename Identifier - Change the type of the form.
Execute the program - it crashes when it tries to change the Caption. Hover mouse over Button1, it shows &LtPos;nil>.
------
Open the .lfm file and fix the unchanged identifier(s). Run | Cleanup and Build
when done, execute the program and it runs successfully.
Mantis conversion info:
- Mantis ID: 29423
- OS: Linux Mint 17. Raspbian
- OS Build: many
- Build: 2016-01-13
- Platform: Lazarus
- Version: 1.4.4
- Monitored by: » @FTurtle (FTurtle)