From cdba747a53082a7f36534dffa6a3ad01628e53c3 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 23 Mar 2017 09:17:10 -0400 Subject: Cleanup DocType defines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- fpdfsdk/cpdfsdk_pageview.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fpdfsdk/cpdfsdk_pageview.cpp') 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(pClip.left), static_cast(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 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 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; -- cgit v1.2.3