summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-23 09:17:10 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-23 13:50:52 +0000
commitcdba747a53082a7f36534dffa6a3ad01628e53c3 (patch)
tree4df0b15de7600592588a263deb9a3adee617f417 /fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
parent1bbedec89cc59df3e305dc25082d9699237d70ab (diff)
downloadpdfium-cdba747a53082a7f36534dffa6a3ad01628e53c3.tar.xz
Cleanup DocType defines
This Cl synchronizes the DocType's defined in XFA with the DOCTYPE flag used in public/. The internal XFA version is converted to an enum class. Change-Id: I1f7be71a200c1ec0f09f9b08099791da1f4fa2e4 Reviewed-on: https://pdfium-review.googlesource.com/3152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_context.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index 653e086e16..8d2996f1de 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -34,7 +34,7 @@ extern int GetLastError();
#endif
CPDFXFA_Context::CPDFXFA_Context(std::unique_ptr<CPDF_Document> pPDFDoc)
- : m_iDocType(DOCTYPE_PDF),
+ : m_iDocType(XFA_DocType::PDF),
m_pPDFDoc(std::move(pPDFDoc)),
m_pFormFillEnv(nullptr),
m_pXFADocView(nullptr),
@@ -114,10 +114,10 @@ bool CPDFXFA_Context::LoadXFADoc() {
m_pXFADoc->StopLoad();
m_pXFADoc->GetXFADoc()->InitScriptContext(GetJSERuntime());
- if (m_pXFADoc->GetDocType() == XFA_DOCTYPE_Dynamic)
- m_iDocType = DOCTYPE_DYNAMIC_XFA;
+ if (m_pXFADoc->GetDocType() == XFA_DocType::Dynamic)
+ m_iDocType = XFA_DocType::Dynamic;
else
- m_iDocType = DOCTYPE_STATIC_XFA;
+ m_iDocType = XFA_DocType::Static;
m_pXFADocView = m_pXFADoc->CreateDocView();
if (m_pXFADocView->StartLayout() < 0) {
@@ -138,11 +138,11 @@ int CPDFXFA_Context::GetPageCount() const {
return 0;
switch (m_iDocType) {
- case DOCTYPE_PDF:
- case DOCTYPE_STATIC_XFA:
+ case XFA_DocType::PDF:
+ case XFA_DocType::Static:
if (m_pPDFDoc)
return m_pPDFDoc->GetPageCount();
- case DOCTYPE_DYNAMIC_XFA:
+ case XFA_DocType::Dynamic:
if (m_pXFADoc)
return m_pXFADocView->CountPageViews();
default:
@@ -184,7 +184,7 @@ CPDFXFA_Page* CPDFXFA_Context::GetXFAPage(CXFA_FFPageView* pPage) const {
if (!m_pXFADoc)
return nullptr;
- if (m_iDocType != DOCTYPE_DYNAMIC_XFA)
+ if (m_iDocType != XFA_DocType::Dynamic)
return nullptr;
for (CPDFXFA_Page* pTempPage : m_XFAPageList) {