diff options
author | tsepez <tsepez@chromium.org> | 2016-05-12 15:52:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 15:52:14 -0700 |
commit | 28c7844c1ef5ea0c8727b890e9ff56b593119a00 (patch) | |
tree | a96e31bbff3c221a0030e3a8a6501a5f81379d0f /core/fpdfapi/fpdf_font/fpdf_font.cpp | |
parent | ade9465067098d9f94a13f61741cebf4bb8aac47 (diff) | |
download | pdfium-28c7844c1ef5ea0c8727b890e9ff56b593119a00.tar.xz |
Add CFX_ByteStringC::CharAt() to avoid c_str() and casts.
Most of the time, we want to operate on chars as if they
were unsigned, but there are a few places where we need
the default (questionably signed) values. Consolidate
the casting in a single place rather than forcing callers
to get a char* ptr.
BUG=pdfium:493
Review-Url: https://codereview.chromium.org/1972053003
Diffstat (limited to 'core/fpdfapi/fpdf_font/fpdf_font.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_font/fpdf_font.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp index dccce5656b..9f7b127d60 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp @@ -139,12 +139,12 @@ uint32_t CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) { int result = 0; if (str[0] == '<') { for (int i = 1; i < len && std::isxdigit(str[i]); ++i) - result = result * 16 + FXSYS_toHexDigit(str[i]); + result = result * 16 + FXSYS_toHexDigit(str.CharAt(i)); return result; } for (int i = 0; i < len && std::isdigit(str[i]); ++i) - result = result * 10 + FXSYS_toDecimalDigit(static_cast<FX_CHAR>(str[i])); + result = result * 10 + FXSYS_toDecimalDigit(str.CharAt(i)); return result; } |