What is the reason for this surprising behaviour, that seems to have started after I upgraded Delphi from XE2 to 10.4.2, namely that empty string property values get stored to the .DFM file?
Empty string is supposed to be a built-in automatic default, i.e. not stored, for properties.
This happens for string properties named Text, in two components that derive from TWinControl (one directly, the other via TCustomEdit). Could it be because TWinControl derives from TControl, which also has a property called Text, but of type TCaption instead of type string? That was the same in XE2, but maybe "properties that hide other properties" are treated differently now in 10.4 compared to back then?
I could solve the sprinkling of unnecessary Text = ''
in my .DFM files by addding a stored directive + a function – but I think I shouldn't really have to, should I?
property Text: string read GetText write SetText stored IsTextStored;
function TMyComponent.IsTextStored: Boolean;
begin
Result := Text <> '';
end;