summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_document.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-05 15:46:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-05 15:46:15 -0700
commit2116105b7d0545eb353264d4b42420cf51af5195 (patch)
tree959cb01c9d4049a9354657a7ea772b1c2860ab92 /fpdfsdk/fpdfxfa/cpdfxfa_document.h
parente883afcab15b17769bda0a1aac0f540568df3368 (diff)
downloadpdfium-2116105b7d0545eb353264d4b42420cf51af5195.tar.xz
Remove ownership of CPDFSDK_Document from CPDFXFA_Document
This CL updates CPDFXFA_Document so it never owns the CPDFSDK_Document. The CPDFSDK_Document is now always owned by the CPDFXFA_Environment. This also cleans up the strange need to reverse the order of document and form destruction when using XFA. Review-Url: https://codereview.chromium.org/2397473006
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_document.h')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_document.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_document.h b/fpdfsdk/fpdfxfa/cpdfxfa_document.h
index f67a880a36..fa415f917c 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_document.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_document.h
@@ -40,8 +40,8 @@ class CPDFXFA_Document {
CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; }
int GetDocType() const { return m_iDocType; }
- CPDFSDK_Document* GetSDKDoc() const { return m_pSDKDoc.get(); }
- void SetSDKDoc(std::unique_ptr<CPDFSDK_Document> pSDKDoc);
+ CPDFSDK_Document* GetSDKDoc() const { return m_pSDKDoc; }
+ void SetSDKDoc(CPDFSDK_Document* pSDKDoc) { m_pSDKDoc = pSDKDoc; }
void DeletePage(int page_index);
int GetPageCount() const;
@@ -78,10 +78,8 @@ class CPDFXFA_Document {
int m_iDocType;
std::unique_ptr<CPDF_Document> m_pPDFDoc;
- // |m_pSDKDoc| must be destroyed before |m_pPDFDoc| since it needs to access
- // it to kill focused annotations.
- std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
std::unique_ptr<CXFA_FFDoc> m_pXFADoc;
+ CPDFSDK_Document* m_pSDKDoc; // not owned.
CXFA_FFDocView* m_pXFADocView; // not owned.
CPDFXFA_App* const m_pApp;
CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;