diff options
Diffstat (limited to 'fpdfsdk/fpdfxfa/include')
-rw-r--r-- | fpdfsdk/fpdfxfa/include/fpdfxfa_app.h | 5 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h | 14 |
2 files changed, 9 insertions, 10 deletions
diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h index 5ebb2c2623..18cac4405b 100644 --- a/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h +++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h @@ -21,7 +21,7 @@ class CPDFXFA_App : public IXFA_AppProvider { ~CPDFXFA_App() override; FX_BOOL Initialize(v8::Isolate* pIsolate); - CXFA_FFApp* GetXFAApp() { return m_pXFAApp; } + CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } FX_BOOL AddFormFillEnv(CPDFDoc_Environment* pEnv); FX_BOOL RemoveFormFillEnv(CPDFDoc_Environment* pEnv); @@ -74,9 +74,8 @@ class CPDFXFA_App : public IXFA_AppProvider { protected: FX_BOOL m_bJavaScriptInitialized; - CXFA_FFApp* m_pXFAApp; + std::unique_ptr<CXFA_FFApp> m_pXFAApp; v8::Isolate* m_pIsolate; - IFXJS_Runtime* m_pJSRuntime; CFX_WideString m_csAppType; }; diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h index 21a5b13cfa..ed4c8727fc 100644 --- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h +++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h @@ -9,6 +9,7 @@ #include "xfa/fxfa/include/xfa_ffdoc.h" +#include <memory> #include <vector> #include "public/fpdfview.h" @@ -32,7 +33,7 @@ class CPDFXFA_Document : public IXFA_DocProvider { FX_BOOL LoadXFADoc(); CPDFXFA_App* GetApp() { return m_pApp; } CPDF_Document* GetPDFDoc() { return m_pPDFDoc; } - CXFA_FFDoc* GetXFADoc() { return m_pXFADoc; } + CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } int GetPageCount(); @@ -193,18 +194,17 @@ class CPDFXFA_Document : public IXFA_DocProvider { void CloseXFADoc(CXFA_FFDocHandler* pDoc) { if (pDoc) { m_pXFADoc->CloseDoc(); - delete m_pXFADoc; - m_pXFADoc = nullptr; + m_pXFADoc.reset(); m_pXFADocView = nullptr; } } int m_iDocType; CPDF_Document* m_pPDFDoc; - CPDFSDK_Document* m_pSDKDoc; - CXFA_FFDoc* m_pXFADoc; - CXFA_FFDocView* m_pXFADocView; - CPDFXFA_App* m_pApp; + std::unique_ptr<CPDFSDK_Document> m_pSDKDoc; + std::unique_ptr<CXFA_FFDoc> m_pXFADoc; + CXFA_FFDocView* m_pXFADocView; // not owned. + CPDFXFA_App* const m_pApp; IJS_Context* m_pJSContext; CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; LoadStatus m_nLoadStatus; |