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/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (pInterForm) { | 473 if (pInterForm) { |
474 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); | 474 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
475 #ifdef PDF_ENABLE_XFA | 475 #ifdef PDF_ENABLE_XFA |
476 if (page->GetPDFPage()) | 476 if (page->GetPDFPage()) |
477 pPDFInterForm->FixPageFields(page->GetPDFPage()); | 477 pPDFInterForm->FixPageFields(page->GetPDFPage()); |
478 #else // PDF_ENABLE_XFA | 478 #else // PDF_ENABLE_XFA |
479 pPDFInterForm->FixPageFields(page); | 479 pPDFInterForm->FixPageFields(page); |
480 #endif // PDF_ENABLE_XFA | 480 #endif // PDF_ENABLE_XFA |
481 } | 481 } |
482 #ifndef PDF_ENABLE_XFA | 482 #ifndef PDF_ENABLE_XFA |
483 m_page->SetPrivateData((void*)m_page, (void*)this, nullptr); | 483 m_page->SetView(this); |
484 #endif // PDF_ENABLE_XFA | 484 #endif // PDF_ENABLE_XFA |
485 } | 485 } |
486 | 486 |
487 CPDFSDK_PageView::~CPDFSDK_PageView() { | 487 CPDFSDK_PageView::~CPDFSDK_PageView() { |
488 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); | 488 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); |
489 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); | 489 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); |
490 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) | 490 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) |
491 pAnnotHandlerMgr->ReleaseAnnot(pAnnot); | 491 pAnnotHandlerMgr->ReleaseAnnot(pAnnot); |
492 | 492 |
493 m_fxAnnotArray.clear(); | 493 m_fxAnnotArray.clear(); |
494 m_pAnnotList.reset(); | 494 m_pAnnotList.reset(); |
495 #ifndef PDF_ENABLE_XFA | 495 #ifndef PDF_ENABLE_XFA |
496 m_page->RemovePrivateData((void*)m_page); | 496 m_page->SetView(nullptr); |
497 if (m_bTakeOverPage) { | 497 if (m_bTakeOverPage) { |
498 delete m_page; | 498 delete m_page; |
499 } | 499 } |
500 #endif // PDF_ENABLE_XFA | 500 #endif // PDF_ENABLE_XFA |
501 } | 501 } |
502 | 502 |
503 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, | 503 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, |
504 CFX_Matrix* pUser2Device, | 504 CFX_Matrix* pUser2Device, |
505 #ifdef PDF_ENABLE_XFA | 505 #ifdef PDF_ENABLE_XFA |
506 CPDF_RenderOptions* pOptions, | 506 CPDF_RenderOptions* pOptions, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1015 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1016 if (!pFocusAnnot) | 1016 if (!pFocusAnnot) |
1017 return nullptr; | 1017 return nullptr; |
1018 | 1018 |
1019 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1019 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1020 if (pAnnot == pFocusAnnot) | 1020 if (pAnnot == pFocusAnnot) |
1021 return pAnnot; | 1021 return pAnnot; |
1022 } | 1022 } |
1023 return nullptr; | 1023 return nullptr; |
1024 } | 1024 } |
OLD | NEW |