| 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_formfillenvironment.h" | 10 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 m_pApp(pProvider), | 37 m_pApp(pProvider), |
| 38 m_nLoadStatus(FXFA_LOADSTATUS_PRELOAD), | 38 m_nLoadStatus(FXFA_LOADSTATUS_PRELOAD), |
| 39 m_nPageCount(0), | 39 m_nPageCount(0), |
| 40 m_DocEnv(this) {} | 40 m_DocEnv(this) {} |
| 41 | 41 |
| 42 CPDFXFA_Document::~CPDFXFA_Document() { | 42 CPDFXFA_Document::~CPDFXFA_Document() { |
| 43 m_nLoadStatus = FXFA_LOADSTATUS_CLOSING; | 43 m_nLoadStatus = FXFA_LOADSTATUS_CLOSING; |
| 44 | 44 |
| 45 if (m_pFormFillEnv) { | 45 if (m_pFormFillEnv) { |
| 46 m_pFormFillEnv->ClearAllFocusedAnnots(); | 46 m_pFormFillEnv->ClearAllFocusedAnnots(); |
| 47 // Once we're deleted the SDKDocument will point at a bad underlying | 47 // Once we're deleted the FormFillEnvironment will point at a bad underlying |
| 48 // doc so we need to reset it ... | 48 // doc so we need to reset it ... |
| 49 m_pFormFillEnv->ResetXFADocument(); | 49 m_pFormFillEnv->ResetXFADocument(); |
| 50 m_pFormFillEnv = nullptr; | 50 m_pFormFillEnv = nullptr; |
| 51 } | 51 } |
| 52 | 52 |
| 53 if (m_pXFADoc) { | 53 if (m_pXFADoc) { |
| 54 CXFA_FFApp* pApp = m_pApp->GetXFAApp(); | 54 CXFA_FFApp* pApp = m_pApp->GetXFAApp(); |
| 55 if (pApp) { | 55 if (pApp) { |
| 56 CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler(); | 56 CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler(); |
| 57 if (pDocHandler) | 57 if (pDocHandler) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 | 197 |
| 198 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { | 198 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { |
| 199 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr); | 199 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void CPDFXFA_Document::ClearChangeMark() { | 202 void CPDFXFA_Document::ClearChangeMark() { |
| 203 if (m_pFormFillEnv) | 203 if (m_pFormFillEnv) |
| 204 m_pFormFillEnv->ClearChangeMark(); | 204 m_pFormFillEnv->ClearChangeMark(); |
| 205 } | 205 } |
| OLD | NEW |