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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_page.h" | 9 #include "../../../include/fpdfapi/fpdf_page.h" |
10 #include "../../../src/fxcrt/fx_safe_types.h" | 10 #include "../../../src/fxcrt/fx_safe_types.h" |
(...skipping 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3387 m_docStatus = PDF_DATAAVAIL_LOADALLFILE; | 3387 m_docStatus = PDF_DATAAVAIL_LOADALLFILE; |
3388 return TRUE; | 3388 return TRUE; |
3389 } | 3389 } |
3390 if (!m_pRoot) { | 3390 if (!m_pRoot) { |
3391 if (m_docStatus == PDF_DATAAVAIL_ERROR) { | 3391 if (m_docStatus == PDF_DATAAVAIL_ERROR) { |
3392 m_docStatus = PDF_DATAAVAIL_LOADALLFILE; | 3392 m_docStatus = PDF_DATAAVAIL_LOADALLFILE; |
3393 return TRUE; | 3393 return TRUE; |
3394 } | 3394 } |
3395 return FALSE; | 3395 return FALSE; |
3396 } | 3396 } |
3397 CPDF_Reference* pRef = (CPDF_Reference*)m_pRoot->GetDict()->GetElement(FX_BS
TRC("Pages")); | 3397 CPDF_Dictionary* pDict = m_pRoot->GetDict(); |
| 3398 if (!pDict) { |
| 3399 m_docStatus = PDF_DATAAVAIL_ERROR; |
| 3400 return FALSE; |
| 3401 } |
| 3402 CPDF_Reference* pRef = (CPDF_Reference*)pDict->GetElement(FX_BSTRC("Pages"))
; |
3398 if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) { | 3403 if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) { |
3399 m_docStatus = PDF_DATAAVAIL_ERROR; | 3404 m_docStatus = PDF_DATAAVAIL_ERROR; |
3400 return FALSE; | 3405 return FALSE; |
3401 } | 3406 } |
3402 m_PagesObjNum = pRef->GetRefObjNum(); | 3407 m_PagesObjNum = pRef->GetRefObjNum(); |
3403 CPDF_Reference* pAcroFormRef = (CPDF_Reference*)m_pRoot->GetDict()->GetEleme
nt(FX_BSTRC("AcroForm")); | 3408 CPDF_Reference* pAcroFormRef = (CPDF_Reference*)m_pRoot->GetDict()->GetEleme
nt(FX_BSTRC("AcroForm")); |
3404 if (pAcroFormRef && pAcroFormRef->GetType() == PDFOBJ_REFERENCE) { | 3409 if (pAcroFormRef && pAcroFormRef->GetType() == PDFOBJ_REFERENCE) { |
3405 m_bHaveAcroForm = TRUE; | 3410 m_bHaveAcroForm = TRUE; |
3406 m_dwAcroFormObjNum = pAcroFormRef->GetRefObjNum(); | 3411 m_dwAcroFormObjNum = pAcroFormRef->GetRefObjNum(); |
3407 } | 3412 } |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4642 { | 4647 { |
4643 FX_INT32 iSize = m_childNode.GetSize(); | 4648 FX_INT32 iSize = m_childNode.GetSize(); |
4644 for (FX_INT32 i = 0; i < iSize; ++i) { | 4649 for (FX_INT32 i = 0; i < iSize; ++i) { |
4645 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4650 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4646 if (pNode) { | 4651 if (pNode) { |
4647 delete pNode; | 4652 delete pNode; |
4648 } | 4653 } |
4649 } | 4654 } |
4650 m_childNode.RemoveAll(); | 4655 m_childNode.RemoveAll(); |
4651 } | 4656 } |
OLD | NEW |