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

Unified Diff: fpdfsdk/fpdfxfa/cpdfxfa_document.h

Issue 2414883006: Revert of Reland: Make the CPDFXFA_App non-global (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/cpdfxfa_app.cpp ('k') | fpdfsdk/fpdfxfa/cpdfxfa_document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/cpdfxfa_document.h
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_document.h b/fpdfsdk/fpdfxfa/cpdfxfa_document.h
index 88c0e60f2d9d45b58a0d24d44eed38e440aa1167..de997c16f3f0591afaf3e39ca020f605b6618185 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_document.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_document.h
@@ -9,11 +9,11 @@
#include <memory>
-#include "fpdfsdk/fpdfxfa/cpdfxfa_app.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h"
#include "xfa/fxfa/xfa_ffdoc.h"
class CPDFSDK_FormFillEnvironment;
+class CPDFXFA_App;
class CPDFXFA_Page;
class CXFA_FFDocHandler;
class IJS_Runtime;
@@ -29,7 +29,8 @@
class CPDFXFA_Document {
public:
- CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc);
+ CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc,
+ CPDFXFA_App* pProvider);
~CPDFXFA_Document();
FX_BOOL LoadXFADoc();
@@ -37,11 +38,9 @@
CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); }
CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; }
int GetDocType() const { return m_iDocType; }
- CPDFXFA_App* GetApp(); // Creates if needed.
CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; }
void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) {
- GetApp()->SetFormFillEnv(pFormFillEnv);
m_pFormFillEnv = pFormFillEnv;
}
@@ -69,7 +68,13 @@
CFX_ArrayTemplate<CPDFXFA_Page*>* GetXFAPageList() { return &m_XFAPageList; }
private:
- void CloseXFADoc(CXFA_FFDocHandler* pDoc);
+ void CloseXFADoc(CXFA_FFDocHandler* pDoc) {
+ if (pDoc) {
+ m_pXFADoc->CloseDoc();
+ m_pXFADoc.reset();
+ m_pXFADocView = nullptr;
+ }
+ }
int m_iDocType;
@@ -77,7 +82,7 @@
std::unique_ptr<CXFA_FFDoc> m_pXFADoc;
CPDFSDK_FormFillEnvironment* m_pFormFillEnv; // not owned.
CXFA_FFDocView* m_pXFADocView; // not owned.
- std::unique_ptr<CPDFXFA_App> m_pApp;
+ CPDFXFA_App* const m_pApp;
CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
LoadStatus m_nLoadStatus;
int m_nPageCount;
« no previous file with comments | « fpdfsdk/fpdfxfa/cpdfxfa_app.cpp ('k') | fpdfsdk/fpdfxfa/cpdfxfa_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698