diff options
Diffstat (limited to 'fpdfsdk/src/fsdk_baseannot.cpp')
-rw-r--r-- | fpdfsdk/src/fsdk_baseannot.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 1ccac9275a..52f34fae8e 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -4,7 +4,6 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "../../core/include/fxcrt/fx_ext.h" #include "../include/fsdk_define.h" #include "../include/fsdk_mgr.h" #include "../include/fsdk_baseannot.h" @@ -217,9 +216,12 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( int i = 0; int j, k; FX_CHAR ch; - while (i < strLength && !std::isdigit(dtStr[i])) - ++i; - + while (i < strLength) { + ch = dtStr[i]; + if (ch >= '0' && ch <= '9') + break; + i++; + } if (i >= strLength) return *this; @@ -227,9 +229,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 4) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -241,9 +243,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -255,9 +257,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -269,9 +271,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -283,9 +285,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -297,9 +299,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -318,9 +320,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } @@ -335,9 +337,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( k = 0; while (i < strLength && j < 2) { ch = dtStr[i]; - k = k * 10 + FXSYS_toDecimalDigit(ch); + k = k * 10 + ch - '0'; j++; - if (!std::isdigit(ch)) + if (ch < '0' || ch > '9') break; i++; } |