Setting the default property value via popup menu in OI window does not invalidates the project

  • Lazarus/FPC Version: Lazarus 4.4 (rev lazarus_4_4) FPC 3.2.2 x86_64-win64-win32/win64
  • Operating System: Windows 11
  • CPU/Bitness: 64-bit

What happens

The bug affects at least all integer properties that have a specific default value and are grouped in a separate property node represented by an object inheriting from TPersistent. For example, the Constraints, Font, etc. and any custom property groups.

The problem manifests itself in that clicking on the restore default value item in the pop-up menu of the Object Inspector window sets the default value in the OI window and refreshes the designer, but does not physically update the project data (.lfm file), so the form module in the code editor window is not marked as modified (the tab does not have an asterisk preceding the module name).

For example, restoring the default Constraints.MaxHeight using the popup menu does not modify the contents of the .lfm file:

image

But if you manually enter the integer value in the property editor (even equal to the default value), such change will update the .lfm file and invalidates the project, so the asterisk will be added to the code editor page. So only this popup menu item is buggy.

What did you expect

Clicking on an item that restores the default value of an integer property should update the .lfm file and invalidate the project.

Steps to reproduce

  • Create empty application project and save it to the disk.
  • Open the code editor with the form module, form designer and the Object Inspector window.
  • Set the Constraints.MaxHeight property to any non-zero value (zero is default).
  • Save changes.
  • Click RMB on the Constraints.MaxHeight property and in the popup menu click the Set to default: 0 item.

Check the code editor — the tab does not have an asterisk prefix, so the .lfm file has not been updated.

Edited by flowCRANE