Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: fpdfsdk/src/javascript/PublicMethods.cpp

Issue 1431683008: Revert "Revert "Revert "Cleanup some numeric code.""" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/javascript/util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/PublicMethods.cpp
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 7ede42db13f6830b7988c822e9ac4e5d3caba19c..e898214cd85d47ee827716955b4709c74b03e628 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -6,7 +6,6 @@
#include "PublicMethods.h"
-#include "../../../core/include/fxcrt/fx_ext.h"
#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "../../include/javascript/IJavaScript.h"
#include "Field.h"
@@ -117,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) {
@@ -397,7 +396,7 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,
FX_WCHAR c = string.GetAt(i);
if (IsDigit((wchar_t)c)) {
- nRet = nRet * 10 + FXSYS_toDecimalDigit(c);
+ nRet = nRet * 10 + (c - '0');
nSkip = i - nStart + 1;
if (nSkip >= nMaxStep)
break;
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/javascript/util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698