| OLD | NEW |
| 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 "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" | 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 CPDF_Document* pPDFDoc = m_pDocument->GetPDFDoc(); | 33 CPDF_Document* pPDFDoc = m_pDocument->GetPDFDoc(); |
| 34 if (!pPDFDoc) | 34 if (!pPDFDoc) |
| 35 return FALSE; | 35 return FALSE; |
| 36 | 36 |
| 37 CPDF_Dictionary* pDict = pPDFDoc->GetPage(m_iPageIndex); | 37 CPDF_Dictionary* pDict = pPDFDoc->GetPage(m_iPageIndex); |
| 38 if (!pDict) | 38 if (!pDict) |
| 39 return FALSE; | 39 return FALSE; |
| 40 | 40 |
| 41 if (!m_pPDFPage || m_pPDFPage->m_pFormDict != pDict) { | 41 if (!m_pPDFPage || m_pPDFPage->m_pFormDict != pDict) { |
| 42 m_pPDFPage.reset(new CPDF_Page(pPDFDoc, pDict, true)); | 42 m_pPDFPage = WrapUnique(new CPDF_Page(pPDFDoc, pDict, true)); |
| 43 m_pPDFPage->ParseContent(); | 43 m_pPDFPage->ParseContent(); |
| 44 } | 44 } |
| 45 return TRUE; | 45 return TRUE; |
| 46 } | 46 } |
| 47 | 47 |
| 48 FX_BOOL CPDFXFA_Page::LoadXFAPageView() { | 48 FX_BOOL CPDFXFA_Page::LoadXFAPageView() { |
| 49 if (!m_pDocument) | 49 if (!m_pDocument) |
| 50 return FALSE; | 50 return FALSE; |
| 51 | 51 |
| 52 CXFA_FFDoc* pXFADoc = m_pDocument->GetXFADoc(); | 52 CXFA_FFDoc* pXFADoc = m_pDocument->GetXFADoc(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 80 } | 80 } |
| 81 default: | 81 default: |
| 82 return FALSE; | 82 return FALSE; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 FX_BOOL CPDFXFA_Page::LoadPDFPage(CPDF_Dictionary* pageDict) { | 86 FX_BOOL CPDFXFA_Page::LoadPDFPage(CPDF_Dictionary* pageDict) { |
| 87 if (!m_pDocument || m_iPageIndex < 0 || !pageDict) | 87 if (!m_pDocument || m_iPageIndex < 0 || !pageDict) |
| 88 return FALSE; | 88 return FALSE; |
| 89 | 89 |
| 90 m_pPDFPage.reset(new CPDF_Page(m_pDocument->GetPDFDoc(), pageDict, true)); | 90 m_pPDFPage = |
| 91 WrapUnique(new CPDF_Page(m_pDocument->GetPDFDoc(), pageDict, true)); |
| 91 m_pPDFPage->ParseContent(); | 92 m_pPDFPage->ParseContent(); |
| 92 return TRUE; | 93 return TRUE; |
| 93 } | 94 } |
| 94 | 95 |
| 95 FX_FLOAT CPDFXFA_Page::GetPageWidth() const { | 96 FX_FLOAT CPDFXFA_Page::GetPageWidth() const { |
| 96 if (!m_pPDFPage && !m_pXFAPageView) | 97 if (!m_pPDFPage && !m_pXFAPageView) |
| 97 return 0.0f; | 98 return 0.0f; |
| 98 | 99 |
| 99 int nDocType = m_pDocument->GetDocType(); | 100 int nDocType = m_pDocument->GetDocType(); |
| 100 switch (nDocType) { | 101 switch (nDocType) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 case DOCTYPE_PDF: | 214 case DOCTYPE_PDF: |
| 214 case DOCTYPE_STATIC_XFA: { | 215 case DOCTYPE_STATIC_XFA: { |
| 215 if (m_pPDFPage) { | 216 if (m_pPDFPage) { |
| 216 m_pPDFPage->GetDisplayMatrix(matrix, xPos, yPos, xSize, ySize, iRotate); | 217 m_pPDFPage->GetDisplayMatrix(matrix, xPos, yPos, xSize, ySize, iRotate); |
| 217 } | 218 } |
| 218 } break; | 219 } break; |
| 219 default: | 220 default: |
| 220 return; | 221 return; |
| 221 } | 222 } |
| 222 } | 223 } |
| OLD | NEW |