summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-08 14:38:54 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-08 14:38:54 -0700
commitcfd4d57800835011b028435e064f13c29243d6e6 (patch)
tree59f3aa156ea2dca9ea4f5b0e964bd41fa4f9455e /core/fxge/ge
parent4c3debb3c91f5842784be30a911b52cdabcab7df (diff)
downloadpdfium-cfd4d57800835011b028435e064f13c29243d6e6.tar.xz
Make converstion explicit from CFX_ByteString to uint8_t*
BUG= Review URL: https://codereview.chromium.org/1868293002
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 4ee2a22ae6..5ef58b5e79 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -751,7 +751,7 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) {
if (name == m_LastFamily) {
return;
}
- const uint8_t* ptr = name;
+ const uint8_t* ptr = name.raw_str();
FX_BOOL bLocalized = FALSE;
for (int i = 0; i < name.GetLength(); i++)
if (ptr[i] > 0x80) {
@@ -1464,15 +1464,16 @@ void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path,
return;
}
CFX_ByteString names =
- FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65);
+ FPDF_LoadTableFromTT(pFile, tables.raw_str(), nTables, 0x6e616d65);
if (names.IsEmpty()) {
return;
}
- CFX_ByteString facename = GetNameFromTT(names, names.GetLength(), 1);
+ CFX_ByteString facename =
+ GetNameFromTT(names.raw_str(), names.GetLength(), 1);
if (facename.IsEmpty()) {
return;
}
- CFX_ByteString style = GetNameFromTT(names, names.GetLength(), 2);
+ CFX_ByteString style = GetNameFromTT(names.raw_str(), names.GetLength(), 2);
if (style != "Regular") {
facename += " " + style;
}
@@ -1481,9 +1482,10 @@ void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path,
CFX_FontFaceInfo* pInfo =
new CFX_FontFaceInfo(path, facename, tables, offset, filesize);
- CFX_ByteString os2 = FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32);
+ CFX_ByteString os2 =
+ FPDF_LoadTableFromTT(pFile, tables.raw_str(), nTables, 0x4f532f32);
if (os2.GetLength() >= 86) {
- const uint8_t* p = (const uint8_t*)os2 + 78;
+ const uint8_t* p = os2.raw_str() + 78;
uint32_t codepages = GET_TT_LONG(p);
if (codepages & (1 << 17)) {
m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET);
@@ -1603,8 +1605,7 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont,
} else {
uint32_t nTables = pFont->m_FontTables.GetLength() / 16;
for (uint32_t i = 0; i < nTables; i++) {
- const uint8_t* p =
- static_cast<const uint8_t*>(pFont->m_FontTables) + i * 16;
+ const uint8_t* p = pFont->m_FontTables.raw_str() + i * 16;
if (GET_TT_LONG(p) == table) {
offset = GET_TT_LONG(p + 8);
datasize = GET_TT_LONG(p + 12);