summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_page.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_page.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_page.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index d3910ae263..508cf7a15f 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -70,15 +70,12 @@ bool CPDFXFA_Page::LoadPage() {
if (!m_pContext || m_iPageIndex < 0)
return false;
- int iDocType = m_pContext->GetDocType();
- switch (iDocType) {
- case DOCTYPE_PDF:
- case DOCTYPE_STATIC_XFA: {
+ switch (m_pContext->GetDocType()) {
+ case XFA_DocType::PDF:
+ case XFA_DocType::Static:
return LoadPDFPage();
- }
- case DOCTYPE_DYNAMIC_XFA: {
+ case XFA_DocType::Dynamic:
return LoadXFAPageView();
- }
default:
return false;
}
@@ -98,15 +95,14 @@ float CPDFXFA_Page::GetPageWidth() const {
if (!m_pPDFPage && !m_pXFAPageView)
return 0.0f;
- int nDocType = m_pContext->GetDocType();
- switch (nDocType) {
- case DOCTYPE_DYNAMIC_XFA: {
+ switch (m_pContext->GetDocType()) {
+ case XFA_DocType::Dynamic: {
if (m_pXFAPageView)
return m_pXFAPageView->GetPageViewRect().width;
break;
}
- case DOCTYPE_STATIC_XFA:
- case DOCTYPE_PDF: {
+ case XFA_DocType::Static:
+ case XFA_DocType::PDF: {
if (m_pPDFPage)
return m_pPDFPage->GetPageWidth();
break;
@@ -122,15 +118,14 @@ float CPDFXFA_Page::GetPageHeight() const {
if (!m_pPDFPage && !m_pXFAPageView)
return 0.0f;
- int nDocType = m_pContext->GetDocType();
- switch (nDocType) {
- case DOCTYPE_PDF:
- case DOCTYPE_STATIC_XFA: {
+ switch (m_pContext->GetDocType()) {
+ case XFA_DocType::PDF:
+ case XFA_DocType::Static: {
if (m_pPDFPage)
return m_pPDFPage->GetPageHeight();
break;
}
- case DOCTYPE_DYNAMIC_XFA: {
+ case XFA_DocType::Dynamic: {
if (m_pXFAPageView)
return m_pXFAPageView->GetPageViewRect().height;
break;
@@ -195,17 +190,16 @@ CFX_Matrix CPDFXFA_Page::GetDisplayMatrix(int xPos,
if (!m_pPDFPage && !m_pXFAPageView)
return CFX_Matrix();
- int nDocType = m_pContext->GetDocType();
- switch (nDocType) {
- case DOCTYPE_DYNAMIC_XFA: {
+ switch (m_pContext->GetDocType()) {
+ case XFA_DocType::Dynamic: {
if (m_pXFAPageView) {
return m_pXFAPageView->GetDisplayMatrix(
CFX_Rect(xPos, yPos, xSize, ySize), iRotate);
}
break;
}
- case DOCTYPE_PDF:
- case DOCTYPE_STATIC_XFA: {
+ case XFA_DocType::PDF:
+ case XFA_DocType::Static: {
if (m_pPDFPage)
return m_pPDFPage->GetDisplayMatrix(xPos, yPos, xSize, ySize, iRotate);
break;