| 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> |
| 10 #include <vector> |
| 11 |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 10 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 13 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
| 11 #include "core/fpdfdoc/include/cpdf_annotlist.h" | 14 #include "core/fpdfdoc/include/cpdf_annotlist.h" |
| 12 #include "core/fpdfdoc/include/cpdf_interform.h" | 15 #include "core/fpdfdoc/include/cpdf_interform.h" |
| 13 #include "fpdfsdk/include/cpdfsdk_annot.h" | 16 #include "fpdfsdk/include/cpdfsdk_annot.h" |
| 14 #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" | 17 #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" |
| 15 #include "fpdfsdk/include/cpdfsdk_annotiterator.h" | 18 #include "fpdfsdk/include/cpdfsdk_annotiterator.h" |
| 16 #include "fpdfsdk/include/cpdfsdk_environment.h" | 19 #include "fpdfsdk/include/cpdfsdk_environment.h" |
| 17 #include "fpdfsdk/include/cpdfsdk_interform.h" | 20 #include "fpdfsdk/include/cpdfsdk_interform.h" |
| 18 | 21 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 pAnnotHandlerMgr->Annot_OnLoad(pAnnot); | 484 pAnnotHandlerMgr->Annot_OnLoad(pAnnot); |
| 482 } | 485 } |
| 483 | 486 |
| 484 SetLock(FALSE); | 487 SetLock(FALSE); |
| 485 return; | 488 return; |
| 486 } | 489 } |
| 487 #endif // PDF_ENABLE_XFA | 490 #endif // PDF_ENABLE_XFA |
| 488 | 491 |
| 489 CPDF_Page* pPage = GetPDFPage(); | 492 CPDF_Page* pPage = GetPDFPage(); |
| 490 ASSERT(pPage); | 493 ASSERT(pPage); |
| 491 FX_BOOL bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled(); | 494 bool bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled(); |
| 492 // Disable the default AP construction. | 495 // Disable the default AP construction. |
| 493 CPDF_InterForm::SetUpdateAP(FALSE); | 496 CPDF_InterForm::SetUpdateAP(false); |
| 494 m_pAnnotList.reset(new CPDF_AnnotList(pPage)); | 497 m_pAnnotList.reset(new CPDF_AnnotList(pPage)); |
| 495 CPDF_InterForm::SetUpdateAP(bUpdateAP); | 498 CPDF_InterForm::SetUpdateAP(bUpdateAP); |
| 496 | 499 |
| 497 const size_t nCount = m_pAnnotList->Count(); | 500 const size_t nCount = m_pAnnotList->Count(); |
| 498 for (size_t i = 0; i < nCount; ++i) { | 501 for (size_t i = 0; i < nCount; ++i) { |
| 499 CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); | 502 CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); |
| 500 CheckUnSupportAnnot(GetPDFDocument(), pPDFAnnot); | 503 CheckUnSupportAnnot(GetPDFDocument(), pPDFAnnot); |
| 501 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); | 504 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); |
| 502 if (!pAnnot) | 505 if (!pAnnot) |
| 503 continue; | 506 continue; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 return pAnnot; | 582 return pAnnot; |
| 580 } | 583 } |
| 581 return nullptr; | 584 return nullptr; |
| 582 } | 585 } |
| 583 | 586 |
| 584 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { | 587 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { |
| 585 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; | 588 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; |
| 586 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); | 589 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); |
| 587 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; | 590 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; |
| 588 } | 591 } |
| OLD | NEW |