浏览代码

* 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 -
sergei 14 年之前
父节点
当前提交
b7a56722ff
共有 1 个文件被更改,包括 3 次插入9 次删除
  1. 3 9
      rtl/objpas/cvarutil.inc

+ 3 - 9
rtl/objpas/cvarutil.inc

@@ -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;