* Cleanup variant->string conversions: TryStrToDate and TryStrToTime are redundant because TryStrToDateTime already does the same checks. Patch from Luiz Americo, resolves #19115.

git-svn-id: trunk@17265 -
This commit is contained in:
sergei 2011-04-07 04:10:54 +00:00
parent 6fb666135f
commit b7a56722ff

View File

@ -833,25 +833,19 @@ var
begin
s := WideString(p);
if not (TryStrToDateTime(s, Result) or
TryStrToDate(s, Result) or
TryStrToTime(s, Result)) then
if not TryStrToDateTime(s, Result) then
VariantTypeMismatch(varOleStr, varDate);
end;
Function LStrToDate(p: Pointer) : TDateTime;
begin
if not (TryStrToDateTime(AnsiString(p), Result) or
TryStrToDate(AnsiString(p), Result) or
TryStrToTime(AnsiString(p), Result)) then
if not TryStrToDateTime(AnsiString(p), Result) then
VariantTypeMismatch(varString, varDate);
end;
Function UStrToDate(p: Pointer) : TDateTime;
begin
if not (TryStrToDateTime(UnicodeString(p), Result) or
TryStrToDate(UnicodeString(p), Result) or
TryStrToTime(UnicodeString(p), Result)) then
if not TryStrToDateTime(UnicodeString(p), Result) then
VariantTypeMismatch(varUString, varDate);
end;