summaryrefslogtreecommitdiff
path: root/core/src/fpdftext
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2015-10-29 15:08:50 -0400
committerdan sinclair <dsinclair@chromium.org>2015-10-29 15:08:50 -0400
commit23d576f0b498bd4f37ef2175916223a2e5ea0324 (patch)
treeb6561f688e88f00b437eba6128c1b5129d813a7e /core/src/fpdftext
parent589f7e0a57675efce9810c15a3e9b7c49bf0bc90 (diff)
downloadpdfium-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 'core/src/fpdftext')
-rw-r--r--core/src/fpdftext/fpdf_text.cpp4
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp5
2 files changed, 6 insertions, 3 deletions
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;
}
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index 4459552c84..9ab09e19e4 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -2433,11 +2433,12 @@ FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText,
}
if ((char_left > 'A' && char_left < 'a') ||
(char_left > 'a' && char_left < 'z') ||
- (char_left > 0xfb00 && char_left < 0xfb06) || std::isdigit(char_left) ||
+ (char_left > 0xfb00 && char_left < 0xfb06) ||
+ (char_left >= '0' && char_left <= '9') ||
(char_right > 'A' && char_right < 'a') ||
(char_right > 'a' && char_right < 'z') ||
(char_right > 0xfb00 && char_right < 0xfb06) ||
- std::isdigit(char_right)) {
+ (char_right >= '0' && char_right <= '9')) {
return FALSE;
}
if (!(('A' > char_left || char_left > 'Z') &&