Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h

Issue 928803002: Set the view pointer as NULL after its xfa doc is released (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef _FPDFXFA_DOC_H_ 7 #ifndef _FPDFXFA_DOC_H_
8 #define _FPDFXFA_DOC_H_ 8 #define _FPDFXFA_DOC_H_
9 9
10 class CPDFXFA_App; 10 class CPDFXFA_App;
11 class CPDFXFA_Document; 11 class CPDFXFA_Document;
12 class CPDFXFA_Page; 12 class CPDFXFA_Page;
13 class CPDFSDK_Document; 13 class CPDFSDK_Document;
14 class CPDFDoc_Environment; 14 class CPDFDoc_Environment;
15 class IFXJS_Runtime; 15 class IFXJS_Runtime;
16 class IFXJS_Context; 16 class IFXJS_Context;
17 class IXFA_DocHandler;
17 18
18 class CPDFXFA_Document : public IXFA_DocProvider, public CFX_Object 19 class CPDFXFA_Document : public IXFA_DocProvider, public CFX_Object
19 { 20 {
20 public: 21 public:
21 CPDFXFA_Document(CPDF_Document* pPDFDoc, CPDFXFA_App* pProvider); 22 CPDFXFA_Document(CPDF_Document* pPDFDoc, CPDFXFA_App* pProvider);
22 ~CPDFXFA_Document(); 23 ~CPDFXFA_Document();
23 24
24 FX_BOOL LoadXFADoc(); 25 FX_BOOL LoadXFADoc();
25 void CloseXFADoc();
26 CPDFXFA_App* GetApp() {return m_pApp;} 26 CPDFXFA_App* GetApp() {return m_pApp;}
27 CPDF_Document* GetPDFDoc() { return m_pPDFDoc; } 27 CPDF_Document* GetPDFDoc() { return m_pPDFDoc; }
28 XFA_HDOC GetXFADoc() { return m_pXFADoc; } 28 XFA_HDOC GetXFADoc() { return m_pXFADoc; }
29 IXFA_DocView* GetXFADocView() { return m_pXFADocView; } 29 IXFA_DocView* GetXFADocView() { return m_pXFADocView; }
30 30
31 int GetPageCount(); 31 int GetPageCount();
32 CPDFXFA_Page* GetPage(int page_index); 32 CPDFXFA_Page* GetPage(int page_index);
33 CPDFXFA_Page* GetPage(IXFA_PageView* pPage); 33 CPDFXFA_Page* GetPage(IXFA_PageView* pPage);
34 void RemovePage(CPDFXFA_Page* page); 34 void RemovePage(CPDFXFA_Page* page);
35 int GetDocType(){ return m_iDocType; } 35 int GetDocType(){ return m_iDocType; }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 FX_BOOL _OnBeforeNotifySumbit(); 121 FX_BOOL _OnBeforeNotifySumbit();
122 void _OnAfterNotifySumbit(); 122 void _OnAfterNotifySumbit();
123 FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost); 123 FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost);
124 FX_BOOL _SubmitData(XFA_HDOC hDoc, CXFA_Submit submit); 124 FX_BOOL _SubmitData(XFA_HDOC hDoc, CXFA_Submit submit);
125 FX_BOOL _MailToInfo(CFX_WideString& csURL, CFX_WideString& csToA ddress, CFX_WideString& csCCAddress, CFX_WideString& csBCCAddress, CFX_WideStrin g& csSubject, CFX_WideString& csMsg); 125 FX_BOOL _MailToInfo(CFX_WideString& csURL, CFX_WideString& csToA ddress, CFX_WideString& csCCAddress, CFX_WideString& csBCCAddress, CFX_WideStrin g& csSubject, CFX_WideString& csMsg);
126 FX_BOOL _ExportSubmitFile(FPDF_FILEHANDLER* ppFileHandler, int f ileType, FPDF_DWORD encodeType, FPDF_DWORD flag = 0x01111111); 126 FX_BOOL _ExportSubmitFile(FPDF_FILEHANDLER* ppFileHandler, int f ileType, FPDF_DWORD encodeType, FPDF_DWORD flag = 0x01111111);
127 void _ToXFAContentFlags(CFX_WideString csSrcContent, FPDF_DWO RD& flag); 127 void _ToXFAContentFlags(CFX_WideString csSrcContent, FPDF_DWO RD& flag);
128 void _ClearChangeMark(); 128 void _ClearChangeMark();
129 129
130 private: 130 private:
131 void CloseXFADoc(IXFA_DocHandler* pDoc) {
Tom Sepez 2015/02/17 20:37:24 nit: I'd put the implementation into the .cpp file
132 if (pDoc) {
133 pDoc->CloseDoc(m_pXFADoc);
134 pDoc->ReleaseDoc(m_pXFADoc);
135 m_pXFADoc = NULL;
136 m_pXFADocView = NULL;
137 }
138 }
139
131 CPDF_Document* m_pPDFDoc; 140 CPDF_Document* m_pPDFDoc;
132 XFA_HDOC m_pXFADoc; 141 XFA_HDOC m_pXFADoc;
133 IXFA_DocView* m_pXFADocView; 142 IXFA_DocView* m_pXFADocView;
134 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; 143 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
135 144
136 CPDFSDK_Document* m_pSDKDoc; 145 CPDFSDK_Document* m_pSDKDoc;
137 CPDFXFA_App* m_pApp; 146 CPDFXFA_App* m_pApp;
138 147
139 CFX_MapByteStringToPtr m_XfaGlobalProperty; 148 CFX_MapByteStringToPtr m_XfaGlobalProperty;
140 149
141 CFX_MapByteStringToPtr m_ValueMap; 150 CFX_MapByteStringToPtr m_ValueMap;
142 151
143 IFXJS_Context* m_pJSContext; 152 IFXJS_Context* m_pJSContext;
144 153
145 int m_iDocType; 154 int m_iDocType;
146 }; 155 };
147 156
148 #endif 157 #endif
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698