| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "fpdfsdk/include/fsdk_mgr.h" | 10 #include "fpdfsdk/include/fsdk_mgr.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 m_pActionHandler.reset(new CPDFSDK_ActionHandler()); | 371 m_pActionHandler.reset(new CPDFSDK_ActionHandler()); |
| 372 return m_pActionHandler.get(); | 372 return m_pActionHandler.get(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() { | 375 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() { |
| 376 if (!m_pIFormFiller) | 376 if (!m_pIFormFiller) |
| 377 m_pIFormFiller.reset(new CFFL_IFormFiller(this)); | 377 m_pIFormFiller.reset(new CFFL_IFormFiller(this)); |
| 378 return m_pIFormFiller.get(); | 378 return m_pIFormFiller.get(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 // static |
| 382 CPDFSDK_Document* CPDFSDK_Document::FromFPDFFormHandle( |
| 383 FPDF_FORMHANDLE hHandle) { |
| 384 CPDFDoc_Environment* pEnv = static_cast<CPDFDoc_Environment*>(hHandle); |
| 385 return pEnv ? pEnv->GetSDKDocument() : nullptr; |
| 386 } |
| 387 |
| 381 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, | 388 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, |
| 382 CPDFDoc_Environment* pEnv) | 389 CPDFDoc_Environment* pEnv) |
| 383 : m_pDoc(pDoc), | 390 : m_pDoc(pDoc), |
| 384 m_pFocusAnnot(nullptr), | 391 m_pFocusAnnot(nullptr), |
| 385 m_pEnv(pEnv), | 392 m_pEnv(pEnv), |
| 386 m_bChangeMask(FALSE), | 393 m_bChangeMask(FALSE), |
| 387 m_bBeingDestroyed(FALSE) {} | 394 m_bBeingDestroyed(FALSE) {} |
| 388 | 395 |
| 389 CPDFSDK_Document::~CPDFSDK_Document() { | 396 CPDFSDK_Document::~CPDFSDK_Document() { |
| 390 m_bBeingDestroyed = TRUE; | 397 m_bBeingDestroyed = TRUE; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 924 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 918 if (!pFocusAnnot) | 925 if (!pFocusAnnot) |
| 919 return nullptr; | 926 return nullptr; |
| 920 | 927 |
| 921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 928 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 922 if (pAnnot == pFocusAnnot) | 929 if (pAnnot == pFocusAnnot) |
| 923 return pAnnot; | 930 return pAnnot; |
| 924 } | 931 } |
| 925 return nullptr; | 932 return nullptr; |
| 926 } | 933 } |
| OLD | NEW |