diff options
author | dan sinclair <dsinclair@chromium.org> | 2015-10-29 15:08:50 -0400 |
---|---|---|
committer | dan sinclair <dsinclair@chromium.org> | 2015-10-29 15:08:50 -0400 |
commit | 23d576f0b498bd4f37ef2175916223a2e5ea0324 (patch) | |
tree | b6561f688e88f00b437eba6128c1b5129d813a7e /fpdfsdk/src/javascript | |
parent | 589f7e0a57675efce9810c15a3e9b7c49bf0bc90 (diff) | |
download | pdfium-23d576f0b498bd4f37ef2175916223a2e5ea0324.tar.xz |
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 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/PublicMethods.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/util.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 13239aeb1d..e898214cd8 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -116,7 +116,7 @@ FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch) { } FX_BOOL CJS_PublicMethods::IsDigit(char ch) { - return std::isdigit(ch); + return (ch >= '0' && ch <= '9'); } FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch) { diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index cf10bbd7b4..14e15c1b6f 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -425,7 +425,7 @@ void util::printx(const std::string& cFormat, break; case 'X': { while (itSource < iSize) { - if (std::isdigit(cSource[itSource]) || + if ((cSource[itSource] >= '0' && cSource[itSource] <= '9') || (cSource[itSource] >= 'a' && cSource[itSource] <= 'z') || (cSource[itSource] >= 'A' && cSource[itSource] <= 'Z')) { cPurpose += cSource[itSource]; @@ -450,7 +450,7 @@ void util::printx(const std::string& cFormat, } break; case '9': { while (itSource < iSize) { - if (std::isdigit(cSource[itSource])) { + if (cSource[itSource] >= '0' && cSource[itSource] <= '9') { cPurpose += cSource[itSource]; itSource++; break; |