summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_font.cpp2
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font.cpp4
-rw-r--r--core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp9
3 files changed, 7 insertions, 8 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp
index f143bed541..9fb54a828b 100644
--- a/core/fpdfapi/fpdf_font/cpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp
@@ -149,7 +149,7 @@ FX_BOOL CPDF_Font::IsVertWriting() const {
}
int CPDF_Font::AppendChar(FX_CHAR* buf, uint32_t charcode) const {
- *buf = (FX_CHAR)charcode;
+ *buf = static_cast<FX_CHAR>(charcode);
return 1;
}
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;
}
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index 03975149b0..1e9252fa82 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -87,21 +87,20 @@ int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteStringC& key) {
}
CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
- int size = bstr.GetLength();
- const FX_CHAR* pSrc = bstr.c_str();
if (bstr.Find('#') == -1)
return bstr;
+ int size = bstr.GetLength();
CFX_ByteString result;
FX_CHAR* pDestStart = result.GetBuffer(size);
FX_CHAR* pDest = pDestStart;
for (int i = 0; i < size; i++) {
- if (pSrc[i] == '#' && i < size - 2) {
+ if (bstr[i] == '#' && i < size - 2) {
*pDest++ =
- FXSYS_toHexDigit(pSrc[i + 1]) * 16 + FXSYS_toHexDigit(pSrc[i + 2]);
+ FXSYS_toHexDigit(bstr[i + 1]) * 16 + FXSYS_toHexDigit(bstr[i + 2]);
i += 2;
} else {
- *pDest++ = pSrc[i];
+ *pDest++ = bstr[i];
}
}
result.ReleaseBuffer((FX_STRSIZE)(pDest - pDestStart));