DateTimePicker - Surround the hack for setting TextForNullDate to NULL with ifdef fpc_fullversion < 030200, as nodefault now works with string properties

git-svn-id: trunk@63845 -
This commit is contained in:
zoran 2020-08-29 16:43:52 +00:00
parent 49a3adfab7
commit a04423bc0d

View File

@ -371,7 +371,7 @@ type
property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; property ReadOnly: Boolean read FReadOnly write SetReadOnly default False;
property LeadingZeros: Boolean read FLeadingZeros write SetLeadingZeros; property LeadingZeros: Boolean read FLeadingZeros write SetLeadingZeros;
property TextForNullDate: TCaption property TextForNullDate: TCaption
read FTextForNullDate write SetTextForNullDate; read FTextForNullDate write SetTextForNullDate nodefault;
property NullInputAllowed: Boolean property NullInputAllowed: Boolean
read FNullInputAllowed write SetNullInputAllowed default True; read FNullInputAllowed write SetNullInputAllowed default True;
property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChange: TNotifyEvent read FOnChange write FOnChange;
@ -3876,7 +3876,10 @@ begin
is saved and opened again, then, this property gets default value NULL is saved and opened again, then, this property gets default value NULL
instead of empty string. The following condition seems to be a workaround instead of empty string. The following condition seems to be a workaround
for this. } for this. }
{$if fpc_fullversion < 030200}
// This hack is no more needed since FPC 3.2 (see bug report 31985)
if (AOwner = nil) or not (csReading in Owner.ComponentState) then if (AOwner = nil) or not (csReading in Owner.ComponentState) then
{$endif}
FTextForNullDate := 'NULL'; FTextForNullDate := 'NULL';
FCenturyFrom := 1941; FCenturyFrom := 1941;