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/fpdfxfa/cpdfxfa_document.h" | 7 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" |
8 | 8 |
9 #include "core/fpdfapi/parser/cpdf_document.h" | 9 #include "core/fpdfapi/parser/cpdf_document.h" |
10 #include "fpdfsdk/cpdfsdk_document.h" | |
11 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" | 10 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
12 #include "fpdfsdk/cpdfsdk_interform.h" | 11 #include "fpdfsdk/cpdfsdk_interform.h" |
13 #include "fpdfsdk/cpdfsdk_pageview.h" | 12 #include "fpdfsdk/cpdfsdk_pageview.h" |
14 #include "fpdfsdk/fpdfxfa/cpdfxfa_app.h" | 13 #include "fpdfsdk/fpdfxfa/cpdfxfa_app.h" |
15 #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" | 14 #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" |
16 #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" | 15 #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" |
17 #include "fpdfsdk/fsdk_define.h" | 16 #include "fpdfsdk/fsdk_define.h" |
18 #include "fpdfsdk/javascript/ijs_runtime.h" | 17 #include "fpdfsdk/javascript/ijs_runtime.h" |
19 #include "public/fpdf_formfill.h" | 18 #include "public/fpdf_formfill.h" |
20 #include "xfa/fxfa/cxfa_eventparam.h" | 19 #include "xfa/fxfa/cxfa_eventparam.h" |
(...skipping 16 matching lines...) Expand all Loading... |
37 m_pXFADocView(nullptr), | 36 m_pXFADocView(nullptr), |
38 m_pApp(pProvider), | 37 m_pApp(pProvider), |
39 m_nLoadStatus(FXFA_LOADSTATUS_PRELOAD), | 38 m_nLoadStatus(FXFA_LOADSTATUS_PRELOAD), |
40 m_nPageCount(0), | 39 m_nPageCount(0), |
41 m_DocEnv(this) {} | 40 m_DocEnv(this) {} |
42 | 41 |
43 CPDFXFA_Document::~CPDFXFA_Document() { | 42 CPDFXFA_Document::~CPDFXFA_Document() { |
44 m_nLoadStatus = FXFA_LOADSTATUS_CLOSING; | 43 m_nLoadStatus = FXFA_LOADSTATUS_CLOSING; |
45 | 44 |
46 if (m_pFormFillEnv) { | 45 if (m_pFormFillEnv) { |
47 m_pFormFillEnv->GetSDKDocument()->ClearAllFocusedAnnots(); | 46 m_pFormFillEnv->ClearAllFocusedAnnots(); |
48 // Once we're deleted the SDKDocument will point at a bad underlying | 47 // Once we're deleted the SDKDocument will point at a bad underlying |
49 // doc so we need to reset it ... | 48 // doc so we need to reset it ... |
50 m_pFormFillEnv->GetSDKDocument()->ResetXFADocument(); | 49 m_pFormFillEnv->ResetXFADocument(); |
51 m_pFormFillEnv = nullptr; | 50 m_pFormFillEnv = nullptr; |
52 } | 51 } |
53 | 52 |
54 if (m_pXFADoc) { | 53 if (m_pXFADoc) { |
55 CXFA_FFApp* pApp = m_pApp->GetXFAApp(); | 54 CXFA_FFApp* pApp = m_pApp->GetXFAApp(); |
56 if (pApp) { | 55 if (pApp) { |
57 CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler(); | 56 CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler(); |
58 if (pDocHandler) | 57 if (pDocHandler) |
59 CloseXFADoc(pDocHandler); | 58 CloseXFADoc(pDocHandler); |
60 } | 59 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index)) | 194 if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index)) |
196 pPage->Release(); | 195 pPage->Release(); |
197 } | 196 } |
198 | 197 |
199 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { | 198 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { |
200 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr); | 199 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr); |
201 } | 200 } |
202 | 201 |
203 void CPDFXFA_Document::ClearChangeMark() { | 202 void CPDFXFA_Document::ClearChangeMark() { |
204 if (m_pFormFillEnv) | 203 if (m_pFormFillEnv) |
205 m_pFormFillEnv->GetSDKDocument()->ClearChangeMark(); | 204 m_pFormFillEnv->ClearChangeMark(); |
206 } | 205 } |
OLD | NEW |