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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "pageint.h" 9 #include "pageint.h"
10 CPDF_PageObject* CPDF_PageObject::Create(int type) { 10 CPDF_PageObject* CPDF_PageObject::Create(int type) {
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 m_pResources = pageAttr ? pageAttr->GetDict() : NULL; 807 m_pResources = pageAttr ? pageAttr->GetDict() : NULL;
808 m_pPageResources = m_pResources; 808 m_pPageResources = m_pResources;
809 CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate")); 809 CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate"));
810 int rotate = 0; 810 int rotate = 0;
811 if (pRotate) { 811 if (pRotate) {
812 rotate = pRotate->GetInteger() / 90 % 4; 812 rotate = pRotate->GetInteger() / 90 % 4;
813 } 813 }
814 if (rotate < 0) { 814 if (rotate < 0) {
815 rotate += 4; 815 rotate += 4;
816 } 816 }
817 CPDF_Array *pMediaBox, *pCropBox; 817 CPDF_Array* pMediaBox = ToArray(GetPageAttr(FX_BSTRC("MediaBox")));
818 pMediaBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("MediaBox"));
819 CFX_FloatRect mediabox; 818 CFX_FloatRect mediabox;
820 if (pMediaBox) { 819 if (pMediaBox) {
821 mediabox = pMediaBox->GetRect(); 820 mediabox = pMediaBox->GetRect();
822 mediabox.Normalize(); 821 mediabox.Normalize();
823 } 822 }
824 if (mediabox.IsEmpty()) { 823 if (mediabox.IsEmpty()) {
825 mediabox = CFX_FloatRect(0, 0, 612, 792); 824 mediabox = CFX_FloatRect(0, 0, 612, 792);
826 } 825 }
827 pCropBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("CropBox")); 826
827 CPDF_Array* pCropBox = ToArray(GetPageAttr(FX_BSTRC("CropBox")));
828 if (pCropBox) { 828 if (pCropBox) {
829 m_BBox = pCropBox->GetRect(); 829 m_BBox = pCropBox->GetRect();
830 m_BBox.Normalize(); 830 m_BBox.Normalize();
831 } 831 }
832 if (m_BBox.IsEmpty()) { 832 if (m_BBox.IsEmpty()) {
833 m_BBox = mediabox; 833 m_BBox = mediabox;
834 } else { 834 } else {
835 m_BBox.Intersect(mediabox); 835 m_BBox.Intersect(mediabox);
836 } 836 }
837 if (rotate % 2) { 837 if (rotate % 2) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 (FX_FLOAT)y0); 1004 (FX_FLOAT)y0);
1005 matrix = m_PageMatrix; 1005 matrix = m_PageMatrix;
1006 matrix.Concat(display_matrix); 1006 matrix.Concat(display_matrix);
1007 } 1007 }
1008 CPDF_ParseOptions::CPDF_ParseOptions() { 1008 CPDF_ParseOptions::CPDF_ParseOptions() {
1009 m_bTextOnly = FALSE; 1009 m_bTextOnly = FALSE;
1010 m_bMarkedContent = TRUE; 1010 m_bMarkedContent = TRUE;
1011 m_bSeparateForm = TRUE; 1011 m_bSeparateForm = TRUE;
1012 m_bDecodeInlineImage = FALSE; 1012 m_bDecodeInlineImage = FALSE;
1013 } 1013 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698