Chromium Code Reviews| Index: core/fpdfapi/fpdf_font/cpdf_cidfont.cpp |
| diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp |
| index cde28fd53485a37b6212b6ce663e9f0af8904de3..e783db9e4a2557bc94cf92fd814592bc88c1646f 100644 |
| --- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp |
| +++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp |
| @@ -682,17 +682,17 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph) { |
| if (!name) { |
| return charcode == 0 ? -1 : (int)charcode; |
| } |
| - uint16_t unicode = PDF_UnicodeFromAdobeName(name); |
| - if (unicode) { |
| + uint16_t name_unicode = PDF_UnicodeFromAdobeName(name); |
| + if (name_unicode) { |
| if (bMSUnicode) { |
| - index = FXFT_Get_Char_Index(face, unicode); |
| + index = FXFT_Get_Char_Index(face, name_unicode); |
| } else if (bMacRoman) { |
| uint32_t maccode = |
| - FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, unicode); |
| + FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, name_unicode); |
| index = !maccode ? FXFT_Get_Name_Index(face, (char*)name) |
| : FXFT_Get_Char_Index(face, maccode); |
| } else { |
| - return FXFT_Get_Char_Index(face, unicode); |
| + return FXFT_Get_Char_Index(face, name_unicode); |
| } |
| } else { |
| return charcode == 0 ? -1 : (int)charcode; |
| @@ -815,16 +815,15 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray, |
| if (!pObj) |
| continue; |
| - if (CPDF_Array* pArray = pObj->AsArray()) { |
| + if (CPDF_Array* array_elem = pObj->AsArray()) { |
|
Tom Sepez
2016/06/01 22:23:04
nit: pSomething, also array_elem feels like a scal
Wei Li
2016/06/01 23:40:12
Done.
|
| if (width_status != 1) |
| return; |
| - for (size_t j = 0; j < pArray->GetCount(); j += nElements) { |
| + for (size_t j = 0; j < array_elem->GetCount(); j += nElements) { |
| result.Add(first_code); |
| result.Add(first_code); |
| - for (int k = 0; k < nElements; k++) { |
| - result.Add(pArray->GetIntegerAt(j + k)); |
| - } |
| + for (int k = 0; k < nElements; k++) |
| + result.Add(array_elem->GetIntegerAt(j + k)); |
| first_code++; |
| } |
| width_status = 0; |