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

Unified Diff: core/fpdfapi/fpdf_font/fpdf_font.cpp

Issue 1972053003: Add CFX_ByteStringC::CharAt() to avoid c_str() and casts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months 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 | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/fpdf_font.cpp
diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp
index dccce5656b7c80f772874d642822e23f6b97fdb6..9f7b127d60efb6752f8d4ba153f3d6cfa23454f4 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;
}
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698