| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 m_pActionHandler.reset(new CPDFSDK_ActionHandler()); | 383 m_pActionHandler.reset(new CPDFSDK_ActionHandler()); |
| 384 return m_pActionHandler.get(); | 384 return m_pActionHandler.get(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() { | 387 CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller() { |
| 388 if (!m_pIFormFiller) | 388 if (!m_pIFormFiller) |
| 389 m_pIFormFiller.reset(new CFFL_IFormFiller(this)); | 389 m_pIFormFiller.reset(new CFFL_IFormFiller(this)); |
| 390 return m_pIFormFiller.get(); | 390 return m_pIFormFiller.get(); |
| 391 } | 391 } |
| 392 | 392 |
| 393 // static |
| 394 CPDFSDK_Document* CPDFSDK_Document::FromFPDFFormHandle( |
| 395 FPDF_FORMHANDLE hHandle) { |
| 396 CPDFDoc_Environment* pEnv = static_cast<CPDFDoc_Environment*>(hHandle); |
| 397 return pEnv ? pEnv->GetSDKDocument() : nullptr; |
| 398 } |
| 399 |
| 393 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, | 400 CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, |
| 394 CPDFDoc_Environment* pEnv) | 401 CPDFDoc_Environment* pEnv) |
| 395 : m_pDoc(pDoc), | 402 : m_pDoc(pDoc), |
| 396 m_pFocusAnnot(nullptr), | 403 m_pFocusAnnot(nullptr), |
| 397 m_pEnv(pEnv), | 404 m_pEnv(pEnv), |
| 398 m_bChangeMask(FALSE), | 405 m_bChangeMask(FALSE), |
| 399 m_bBeingDestroyed(FALSE) {} | 406 m_bBeingDestroyed(FALSE) {} |
| 400 | 407 |
| 401 CPDFSDK_Document::~CPDFSDK_Document() { | 408 CPDFSDK_Document::~CPDFSDK_Document() { |
| 402 m_bBeingDestroyed = TRUE; | 409 m_bBeingDestroyed = TRUE; |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1179 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 1173 if (!pFocusAnnot) | 1180 if (!pFocusAnnot) |
| 1174 return nullptr; | 1181 return nullptr; |
| 1175 | 1182 |
| 1176 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1183 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 1177 if (pAnnot == pFocusAnnot) | 1184 if (pAnnot == pFocusAnnot) |
| 1178 return pAnnot; | 1185 return pAnnot; |
| 1179 } | 1186 } |
| 1180 return nullptr; | 1187 return nullptr; |
| 1181 } | 1188 } |
| OLD | NEW |