summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-30 17:41:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-30 17:41:49 +0000
commitda8063f087c379bfd286624338d31a112cae5ba4 (patch)
tree5a395009e71f665703d3685b0e5a5c4806e87d49 /fpdfsdk/cpdfsdk_formfillenvironment.h
parent7c7f78a432a41b7074d225a91a590185e02aacf7 (diff)
downloadpdfium-da8063f087c379bfd286624338d31a112cae5ba4.tar.xz
Make CPDFSDK_FormFillEnvironment always hold a CPDF_Document.
Small step towards removing UnderlyingDocumentType and making FPDF documents always be CPDF documents, regardless of XFA. This improves layering a bit in the process. Change-Id: Ice5ed7ba1ffdd7edfc9c4719f0e3a9cfb22f5790 Reviewed-on: https://pdfium-review.googlesource.com/31672 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_formfillenvironment.h')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index aba3f39c69..8baa5848fd 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -47,8 +47,7 @@ FPDF_WIDESTRING AsFPDFWideString(ByteString* bsUTF16LE);
class CPDFSDK_FormFillEnvironment
: public Observable<CPDFSDK_FormFillEnvironment> {
public:
- CPDFSDK_FormFillEnvironment(UnderlyingDocumentType* pDoc,
- FPDF_FORMFILLINFO* pFFinfo);
+ CPDFSDK_FormFillEnvironment(CPDF_Document* pDoc, FPDF_FORMFILLINFO* pFFinfo);
~CPDFSDK_FormFillEnvironment();
static bool IsSHIFTKeyDown(uint32_t nFlag) {
@@ -112,16 +111,10 @@ class CPDFSDK_FormFillEnvironment
float* fPosArray,
int sizeOfArray);
- UnderlyingDocumentType* GetUnderlyingDocument() const {
- return m_pUnderlyingDoc.Get();
- }
+ CPDF_Document* GetPDFDocument() const { return m_pCPDFDoc.Get(); }
#ifdef PDF_ENABLE_XFA
- CPDF_Document* GetPDFDocument() const;
-
- CPDFXFA_Context* GetXFAContext() const { return m_pUnderlyingDoc.Get(); }
- void ResetXFADocument() { m_pUnderlyingDoc = nullptr; }
-
+ CPDFXFA_Context* GetXFAContext() const;
int GetPageViewCount() const { return m_PageMap.size(); }
void DisplayCaret(CPDFXFA_Page* page,
@@ -169,8 +162,6 @@ class CPDFSDK_FormFillEnvironment
WideString GetLanguage();
void PageEvent(int iPageCount, uint32_t dwEventType) const;
-#else // PDF_ENABLE_XFA
- CPDF_Document* GetPDFDocument() const { return m_pUnderlyingDoc.Get(); }
#endif // PDF_ENABLE_XFA
int JS_appAlert(const WideString& Msg,
@@ -228,7 +219,7 @@ class CPDFSDK_FormFillEnvironment
std::map<UnderlyingPageType*, std::unique_ptr<CPDFSDK_PageView>> m_PageMap;
std::unique_ptr<CPDFSDK_InterForm> m_pInterForm;
CPDFSDK_Annot::ObservedPtr m_pFocusAnnot;
- UnownedPtr<UnderlyingDocumentType> m_pUnderlyingDoc;
+ UnownedPtr<CPDF_Document> const m_pCPDFDoc;
std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller;
std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
bool m_bChangeMask;