| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/include/cpdfsdk_pageview.h" | 7 #include "fpdfsdk/include/cpdfsdk_pageview.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 SetLock(FALSE); | 487 SetLock(FALSE); |
| 488 return; | 488 return; |
| 489 } | 489 } |
| 490 #endif // PDF_ENABLE_XFA | 490 #endif // PDF_ENABLE_XFA |
| 491 | 491 |
| 492 CPDF_Page* pPage = GetPDFPage(); | 492 CPDF_Page* pPage = GetPDFPage(); |
| 493 ASSERT(pPage); | 493 ASSERT(pPage); |
| 494 bool bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled(); | 494 bool bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled(); |
| 495 // Disable the default AP construction. | 495 // Disable the default AP construction. |
| 496 CPDF_InterForm::SetUpdateAP(false); | 496 CPDF_InterForm::SetUpdateAP(false); |
| 497 m_pAnnotList.reset(new CPDF_AnnotList(pPage)); | 497 m_pAnnotList = WrapUnique(new CPDF_AnnotList(pPage)); |
| 498 CPDF_InterForm::SetUpdateAP(bUpdateAP); | 498 CPDF_InterForm::SetUpdateAP(bUpdateAP); |
| 499 | 499 |
| 500 const size_t nCount = m_pAnnotList->Count(); | 500 const size_t nCount = m_pAnnotList->Count(); |
| 501 for (size_t i = 0; i < nCount; ++i) { | 501 for (size_t i = 0; i < nCount; ++i) { |
| 502 CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); | 502 CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); |
| 503 CheckUnSupportAnnot(GetPDFDocument(), pPDFAnnot); | 503 CheckUnSupportAnnot(GetPDFDocument(), pPDFAnnot); |
| 504 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); | 504 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); |
| 505 if (!pAnnot) | 505 if (!pAnnot) |
| 506 continue; | 506 continue; |
| 507 m_fxAnnotArray.push_back(pAnnot); | 507 m_fxAnnotArray.push_back(pAnnot); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 return pAnnot; | 582 return pAnnot; |
| 583 } | 583 } |
| 584 return nullptr; | 584 return nullptr; |
| 585 } | 585 } |
| 586 | 586 |
| 587 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { | 587 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { |
| 588 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; | 588 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; |
| 589 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); | 589 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); |
| 590 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; | 590 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; |
| 591 } | 591 } |
| OLD | NEW |