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

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

Issue 1417893003: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 6ccc4a345be0963e96f4ee151d69ff02f364dfa6..8972201b660df94b5f605b5b4d7e651c9f3639b5 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -1664,14 +1664,13 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
FX_DWORD count = pArray->GetCount();
for (FX_DWORD i = 0; i < count; i++) {
CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj == NULL) {
+ if (!pObj)
continue;
- }
- if (pObj->GetType() == PDFOBJ_ARRAY) {
- if (width_status != 1) {
+
+ if (CPDF_Array* pArray = pObj->AsArray()) {
+ if (width_status != 1)
return;
- }
- CPDF_Array* pArray = (CPDF_Array*)pObj;
+
FX_DWORD count = pArray->GetCount();
for (FX_DWORD j = 0; j < count; j += nElements) {
result.Add(first_code);
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698