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/cpdfsdk_formfillenvironment.h" | 7 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 CPDFSDK_FormFillEnvironment::~CPDFSDK_FormFillEnvironment() { | 46 CPDFSDK_FormFillEnvironment::~CPDFSDK_FormFillEnvironment() { |
47 m_bBeingDestroyed = TRUE; | 47 m_bBeingDestroyed = TRUE; |
48 | 48 |
49 ClearAllFocusedAnnots(); | 49 ClearAllFocusedAnnots(); |
50 for (auto& it : m_pageMap) | 50 for (auto& it : m_pageMap) |
51 delete it.second; | 51 delete it.second; |
52 m_pageMap.clear(); | 52 m_pageMap.clear(); |
53 | 53 |
54 #ifdef PDF_ENABLE_XFA | 54 #ifdef PDF_ENABLE_XFA |
55 CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); | 55 CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); |
56 if (pProvider->m_pEnvList.GetSize() == 0) | 56 if (pProvider->m_pFormFillEnvList.GetSize() == 0) |
57 pProvider->SetJavaScriptInitialized(FALSE); | 57 pProvider->SetJavaScriptInitialized(FALSE); |
58 #endif // PDF_ENABLE_XFA | 58 #endif // PDF_ENABLE_XFA |
59 if (m_pInfo && m_pInfo->Release) | 59 if (m_pInfo && m_pInfo->Release) |
60 m_pInfo->Release(m_pInfo); | 60 m_pInfo->Release(m_pInfo); |
61 } | 61 } |
62 | 62 |
63 int CPDFSDK_FormFillEnvironment::JS_appAlert(const FX_WCHAR* Msg, | 63 int CPDFSDK_FormFillEnvironment::JS_appAlert(const FX_WCHAR* Msg, |
64 const FX_WCHAR* Title, | 64 const FX_WCHAR* Title, |
65 uint32_t Type, | 65 uint32_t Type, |
66 uint32_t Icon) { | 66 uint32_t Icon) { |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 } else { | 756 } else { |
757 m_pFocusAnnot.Reset(pFocusAnnot.Get()); | 757 m_pFocusAnnot.Reset(pFocusAnnot.Get()); |
758 } | 758 } |
759 } | 759 } |
760 return FALSE; | 760 return FALSE; |
761 } | 761 } |
762 | 762 |
763 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { | 763 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { |
764 return GetPDFDocument()->GetUserPermissions() & nFlag; | 764 return GetPDFDocument()->GetUserPermissions() & nFlag; |
765 } | 765 } |
OLD | NEW |