summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_pageview.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/cpdfsdk_pageview.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/cpdfsdk_pageview.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index d5a04fef3e..a1a02ef185 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -94,7 +94,7 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
if (!pPage)
return;
- if (pPage->GetContext()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
+ if (pPage->GetContext()->GetDocType() == XFA_DocType::Dynamic) {
CFX_Graphics gs(pDevice);
CFX_RectF rectClip(
static_cast<float>(pClip.left), static_cast<float>(pClip.top),
@@ -181,9 +181,10 @@ bool CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) {
if (!pAnnot)
return false;
CPDFXFA_Page* pPage = pAnnot->GetPDFXFAPage();
- if (!pPage || (pPage->GetContext()->GetDocType() != DOCTYPE_STATIC_XFA &&
- pPage->GetContext()->GetDocType() != DOCTYPE_DYNAMIC_XFA))
+ if (!pPage || (pPage->GetContext()->GetDocType() != XFA_DocType::Static &&
+ pPage->GetContext()->GetDocType() != XFA_DocType::Dynamic)) {
return false;
+ }
if (GetFocusAnnot() == pAnnot)
m_pFormFillEnv->KillFocusAnnot(0);
@@ -383,7 +384,7 @@ void CPDFSDK_PageView::LoadFXAnnots() {
#ifdef PDF_ENABLE_XFA
CFX_RetainPtr<CPDFXFA_Page> protector(m_page);
- if (m_pFormFillEnv->GetXFAContext()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
+ if (m_pFormFillEnv->GetXFAContext()->GetDocType() == XFA_DocType::Dynamic) {
CXFA_FFPageView* pageView = m_page->GetXFAPageView();
std::unique_ptr<IXFA_WidgetIterator> pWidgetHander(
pageView->CreateWidgetIterator(
@@ -444,14 +445,13 @@ int CPDFSDK_PageView::GetPageIndex() const {
return -1;
#ifdef PDF_ENABLE_XFA
- int nDocType = m_page->GetContext()->GetDocType();
- switch (nDocType) {
- case DOCTYPE_DYNAMIC_XFA: {
+ switch (m_page->GetContext()->GetDocType()) {
+ case XFA_DocType::Dynamic: {
CXFA_FFPageView* pPageView = m_page->GetXFAPageView();
return pPageView ? pPageView->GetPageIndex() : -1;
}
- case DOCTYPE_STATIC_XFA:
- case DOCTYPE_PDF:
+ case XFA_DocType::Static:
+ case XFA_DocType::PDF:
return GetPageIndexForStaticPDF();
default:
return -1;