Is there a way to get the LFM to be populated with the defaults where they are not set by the user?
Not any easy way. AFAIK you would need to modify the component streaming code.
Why would you want that? I have a feeling you try to solve a problem in a wrong way.
I am upgrading an old 2016 components to the latest version of Lazarus and many of the properties and property values have been removed or changed.
Opening them in the IDE catches some of them for removal but not all. On some of them the F12 button does not work and brings up the LFM instead.
The solution I want to try now is to use ReadComponentFromTextStream to repeatedly load the properties from the LFM of the old one to a newly created component in
try except blocks.
The LFM code will be stored in a memo, and when
try except block shows what properties are invalid, I log them, delete them from the memo with LFM code and try again.
The other option is to parse out the properties in the components source code, compare them with those in the LFM and delete the absent ones in the LFM.
I think I will stick to the former for now, because I have to learn how to debug problems in GUIs and emulating the users steps in code and trapping the exceptions in try
except blocks is the only way forward.
and delete the invalid properties when they are trapped in the in the
try except block