Fix Date/Duration/Time string parsing for empty strings (Thanks MVC).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4630 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2016-04-23 16:43:26 +00:00
parent fb72045f86
commit 327dd4aab6

View File

@ -6089,7 +6089,10 @@ end;
procedure TBaseDateRemotable.SetAsString(const AValue: string); procedure TBaseDateRemotable.SetAsString(const AValue: string);
begin begin
FDate := Parse(AValue); if (AValue<>'') then
FDate := Parse(AValue)
else
FillChar(FDate,SizeOf(TDateTimeRec),0);
end; end;
procedure TBaseDateRemotable.SetOffset(const Index: Integer; const Value: Shortint); procedure TBaseDateRemotable.SetOffset(const Index: Integer; const Value: Shortint);
@ -6800,7 +6803,10 @@ end;
procedure TDurationRemotable.SetAsString(const AValue: string); procedure TDurationRemotable.SetAsString(const AValue: string);
begin begin
FData := Parse(AValue); if (AValue<>'') then
FData := Parse(AValue)
else
FillChar(FData,SizeOf(TDurationRec),0);
end; end;
procedure TDurationRemotable.SetNegative(const AValue: Boolean); procedure TDurationRemotable.SetNegative(const AValue: Boolean);
@ -7197,7 +7203,10 @@ end;
procedure TTimeRemotable.SetAsString(const AValue: string); procedure TTimeRemotable.SetAsString(const AValue: string);
begin begin
Data := Parse(AValue); if (AValue<>'') then
Data := Parse(AValue)
else
FillChar(FData,SizeOf(TTimeRec),0);
end; end;
procedure TTimeRemotable.SetMilliSecond(const AValue: Word); procedure TTimeRemotable.SetMilliSecond(const AValue: Word);