diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-23 14:00:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-23 14:00:32 -0700 |
commit | ce56557ef58facf2519f541d5cad33ea121b4c21 (patch) | |
tree | da8de59a3cd5b7abcd7603eba3ba46e0d503daab /xfa/fxfa/parser/cxfa_data.cpp | |
parent | b97784706ec898ff6b1c36f1564c0c66f9419b17 (diff) | |
download | pdfium-ce56557ef58facf2519f541d5cad33ea121b4c21.tar.xz |
Use some FXSYS methods instead of duplicating
This CL uses the FXSYS_isDecimalDigit in place of a few custom IsDigit methods.
It also creates an iswspace and some fractional math helper methods to share
some code.
Review-Url: https://codereview.chromium.org/2094453004
Diffstat (limited to 'xfa/fxfa/parser/cxfa_data.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_data.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp index 7a218516b7..0589adf581 100644 --- a/xfa/fxfa/parser/cxfa_data.cpp +++ b/xfa/fxfa/parser/cxfa_data.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/cxfa_data.h" +#include "core/fxcrt/include/fx_ext.h" #include "xfa/fxfa/parser/xfa_object.h" // Static. @@ -17,14 +18,14 @@ FX_ARGB CXFA_Data::ToColor(const CFX_WideStringC& wsValue) { int cc = 0; const FX_WCHAR* str = wsValue.c_str(); int len = wsValue.GetLength(); - while (XFA_IsSpace(str[cc]) && cc < len) + while (FXSYS_iswspace(str[cc]) && cc < len) cc++; if (cc >= len) return 0xff000000; while (cc < len) { - if (str[cc] == ',' || !XFA_IsDigit(str[cc])) + if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc])) break; r = r * 10 + str[cc] - '0'; @@ -32,11 +33,11 @@ FX_ARGB CXFA_Data::ToColor(const CFX_WideStringC& wsValue) { } if (cc < len && str[cc] == ',') { cc++; - while (XFA_IsSpace(str[cc]) && cc < len) + while (FXSYS_iswspace(str[cc]) && cc < len) cc++; while (cc < len) { - if (str[cc] == ',' || !XFA_IsDigit(str[cc])) + if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc])) break; g = g * 10 + str[cc] - '0'; @@ -44,11 +45,11 @@ FX_ARGB CXFA_Data::ToColor(const CFX_WideStringC& wsValue) { } if (cc < len && str[cc] == ',') { cc++; - while (XFA_IsSpace(str[cc]) && cc < len) + while (FXSYS_iswspace(str[cc]) && cc < len) cc++; while (cc < len) { - if (str[cc] == ',' || !XFA_IsDigit(str[cc])) + if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc])) break; b = b * 10 + str[cc] - '0'; |