From ab1faaa7f81b7dafe03d546341c6a643a58b3678 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 24 Apr 2017 16:16:49 -0700 Subject: Use fx_extension.h utilities in more places in xfa/ Change-Id: Id58c313aa446ecfa223e5c8edc095586b62a61fa Reviewed-on: https://pdfium-review.googlesource.com/4455 Commit-Queue: dsinclair Reviewed-by: dsinclair --- xfa/fxfa/parser/cxfa_widgetdata.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 361c48a6bc..f11a668276 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -51,24 +51,12 @@ bool SplitDateTime(const CFX_WideString& wsDateTime, wsDate = wsDateTime.Left(nSplitIndex); if (!wsDate.IsEmpty()) { - int32_t iCount = wsDate.GetLength(); - int32_t i = 0; - for (i = 0; i < iCount; i++) { - if (wsDate[i] >= '0' && wsDate[i] <= '9') - break; - } - if (i == iCount) + if (!std::any_of(wsDate.begin(), wsDate.end(), std::iswdigit)) return false; } wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1); if (!wsTime.IsEmpty()) { - int32_t iCount = wsTime.GetLength(); - int32_t i = 0; - for (i = 0; i < iCount; i++) { - if (wsTime[i] >= '0' && wsTime[i] <= '9') - break; - } - if (i == iCount) + if (!std::any_of(wsTime.begin(), wsTime.end(), std::iswdigit)) return false; } return true; -- cgit v1.2.3