Handling of properties that are missing from DFM

Issue #25 resolved
Anders Melander repo owner created an issue

In some cases a published property will not be written to the DFM because the stored storage specifier directive evaluates to False.

https://docwiki.embarcadero.com/RADStudio/Sydney/en/Properties_(Delphi)#Storage_Specifiers

For example if the value of TField's DisplayLabel property equals the value of the FieldName property then the DisplayLabel property will not be written to the DFM. As a result of this the DisplayLabel value can not be translated.

Proposed solution

To work around this problem we should introduce functionality that will synthesize property Name/Value pairs in case a property is missing from the DFM. This should happen after all the properties of a component or collection item has been parsed (see: TModuleDFMResourceProcessor.ReadComponent and TModuleDFMResourceProcessor.ReadCollection).
The logic that controls this functionality can be based on a customizable set of rules. The rules can take the form:

Element type Property name Property value
Meaning Regular expression specifying the element (component) type name. Name of the required property. Value to assign the property. Can specify literal value or the name of another property to copy the value from.
Example rule T.*Field DisplayLabel @FieldName
Example rule match TIntegerField DisplayLabel Count

Comments (4)

  1. Anders Melander reporter

    Fixes #25 Properties that has been omitted from the DFM due to defaulting or the "stored" storage specifier can now be synthesized based on on a configurable set of rules.

    → <<cset 8debad1ce3ec>>

  2. Log in to comment