summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-24 13:45:11 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-24 22:35:01 +0000
commitdc8a2b7606c2c6c12d5cfb280dfb49128c1a60ab (patch)
tree8808b5cc14ba97955c8b34db7317b9f35c819eea /xfa
parentedc1e4e5baac33c8f2799e82ff52fd556d3c5e02 (diff)
downloadpdfium-dc8a2b7606c2c6c12d5cfb280dfb49128c1a60ab.tar.xz
Convert to CFX_UnownedPtr, part 10
Change-Id: I4eab5e843580845753c5f80c05cf9490a85114b6 Reviewed-on: https://pdfium-review.googlesource.com/5890 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp4
-rw-r--r--xfa/fxfa/cxfa_ffdoc.h17
2 files changed, 10 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index f7bad38934..bde40ce11f 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -337,10 +337,6 @@ void CXFA_FFDoc::CloseDoc() {
m_pApp->ClearEventTargets();
}
-CPDF_Document* CXFA_FFDoc::GetPDFDoc() {
- return m_pPDFDoc;
-}
-
CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
const CFX_WideStringC& wsName,
int32_t& iImageXDpi,
diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h
index d40e7ba0c8..a43dae3caa 100644
--- a/xfa/fxfa/cxfa_ffdoc.h
+++ b/xfa/fxfa/cxfa_ffdoc.h
@@ -10,6 +10,7 @@
#include <map>
#include <memory>
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "xfa/fxfa/fxfa.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_document_parser.h"
@@ -49,7 +50,9 @@ class CXFA_FFDoc {
CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment);
~CXFA_FFDoc();
- IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; }
+ IXFA_DocEnvironment* GetDocEnvironment() const {
+ return m_pDocEnvironment.Get();
+ }
XFA_DocType GetDocType() const { return m_dwDocType; }
int32_t StartLoad();
@@ -62,11 +65,11 @@ class CXFA_FFDoc {
bool OpenDoc(CPDF_Document* pPDFDoc);
void CloseDoc();
- CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); }
- CXFA_FFApp* GetApp() { return m_pApp; }
+ CXFA_Document* GetXFADoc() const { return m_pDocumentParser->GetDocument(); }
+ CXFA_FFApp* GetApp() const { return m_pApp.Get(); }
+ CPDF_Document* GetPDFDoc() const { return m_pPDFDoc.Get(); }
CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout);
CXFA_FFDocView* GetDocView();
- CPDF_Document* GetPDFDoc();
CFX_RetainPtr<CFX_DIBitmap> GetPDFNamedImage(const CFX_WideStringC& wsName,
int32_t& iImageXDpi,
int32_t& iImageYDpi);
@@ -78,12 +81,12 @@ class CXFA_FFDoc {
bool bXDP = true);
private:
- IXFA_DocEnvironment* const m_pDocEnvironment;
+ CFX_UnownedPtr<IXFA_DocEnvironment> const m_pDocEnvironment;
std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser;
CFX_RetainPtr<IFX_SeekableStream> m_pStream;
- CXFA_FFApp* m_pApp;
+ CFX_UnownedPtr<CXFA_FFApp> m_pApp;
std::unique_ptr<CXFA_FFNotify> m_pNotify;
- CPDF_Document* m_pPDFDoc;
+ CFX_UnownedPtr<CPDF_Document> m_pPDFDoc;
std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap;
std::unique_ptr<CXFA_FFDocView> m_DocView;
XFA_DocType m_dwDocType;