From 9792f16f3ef27a1e0c7f0526cc69637a158e3010 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 16 May 2017 14:11:30 -0700 Subject: Properly ref-count CPDFXFA_Page Change-Id: Ibd1ebe4191f61e20d815de7f1a1094d78b72e6a7 Reviewed-on: https://pdfium-review.googlesource.com/5391 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fpdfsdk/fpdfxfa/cpdfxfa_context.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_context.h') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h index 690e1855e3..6d7e33b689 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h @@ -13,11 +13,11 @@ #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_system.h" #include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" +#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" #include "xfa/fxfa/cxfa_ffdoc.h" class CJS_Runtime; class CPDFSDK_FormFillEnvironment; -class CPDFXFA_Page; class CXFA_FFDocHandler; class IJS_EventContext; class IJS_Runtime; @@ -48,14 +48,10 @@ class CPDFXFA_Context : public IXFA_AppProvider { } void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); - void DeletePage(int page_index); int GetPageCount() const; - - CPDFXFA_Page* GetXFAPage(int page_index); - CPDFXFA_Page* GetXFAPage(CXFA_FFPageView* pPage) const; - - void RemovePage(CPDFXFA_Page* page); - + void DeletePage(int page_index); + CFX_RetainPtr GetXFAPage(int page_index); + CFX_RetainPtr GetXFAPage(CXFA_FFPageView* pPage) const; void ClearChangeMark(); // IFXA_AppProvider: @@ -97,20 +93,21 @@ class CPDFXFA_Context : public IXFA_AppProvider { } LoadStatus GetLoadStatus() const { return m_nLoadStatus; } - std::vector* GetXFAPageList() { return &m_XFAPageList; } + std::vector>* GetXFAPageList() { + return &m_XFAPageList; + } private: void CloseXFADoc(); XFA_DocType m_iDocType; - std::unique_ptr m_pPDFDoc; std::unique_ptr m_pXFADoc; CFX_UnownedPtr m_pFormFillEnv; CFX_UnownedPtr m_pXFADocView; std::unique_ptr m_pXFAApp; std::unique_ptr m_pRuntime; - std::vector m_XFAPageList; + std::vector> m_XFAPageList; LoadStatus m_nLoadStatus; int m_nPageCount; -- cgit v1.2.3