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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page.cpp

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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
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();

Powered by Google App Engine
This is Rietveld 408576698