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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page.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_font/fpdf_font_cid.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index f6f03336a0a4f02bfd3628222e91b100edddd3c7..162acfa8988874ebeb347956df0f485b7cf4ba58 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -814,8 +814,7 @@ void CPDF_Page::Load(CPDF_Document* pDocument,
if (rotate < 0) {
rotate += 4;
}
- CPDF_Array *pMediaBox, *pCropBox;
- pMediaBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("MediaBox"));
+ CPDF_Array* pMediaBox = ToArray(GetPageAttr(FX_BSTRC("MediaBox")));
CFX_FloatRect mediabox;
if (pMediaBox) {
mediabox = pMediaBox->GetRect();
@@ -824,7 +823,8 @@ void CPDF_Page::Load(CPDF_Document* pDocument,
if (mediabox.IsEmpty()) {
mediabox = CFX_FloatRect(0, 0, 612, 792);
}
- pCropBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("CropBox"));
+
+ CPDF_Array* pCropBox = ToArray(GetPageAttr(FX_BSTRC("CropBox")));
if (pCropBox) {
m_BBox = pCropBox->GetRect();
m_BBox.Normalize();
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698