From 23d576f0b498bd4f37ef2175916223a2e5ea0324 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 29 Oct 2015 15:08:50 -0400 Subject: Revert "Cleanup some numeric code." This reverts commit 589f7e0a57675efce9810c15a3e9b7c49bf0bc90. Broke the build on Mac, unable to find std::isdigit. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1428853002 . --- core/src/fpdftext/fpdf_text.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/fpdftext/fpdf_text.cpp') diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index e9ad338025..9ecbc21bda 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -436,8 +436,10 @@ void NormalizeString(CFX_WideString& str) { static FX_BOOL IsNumber(CFX_WideString& str) { for (int i = 0; i < str.GetLength(); i++) { FX_WCHAR ch = str[i]; - if (!std::isdigit(ch) && ch != '-' && ch != '+' && ch != '.' && ch != ' ') + if ((ch < '0' || ch > '9') && ch != '-' && ch != '+' && ch != '.' && + ch != ' ') { return FALSE; + } } return TRUE; } -- cgit v1.2.3