From 222e1a425e2d2199a842883dcc330a549f400630 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 20 Jun 2017 14:47:00 -0700 Subject: Use early returns in more CPDFSDK_FormFillEnvironment code. Same for CFFL_InteractiveFormFiller. Fix other nits in both classes and in related code. Change-Id: I9901c48794358889cc20638455ffd7fcb3344574 Reviewed-on: https://pdfium-review.googlesource.com/6652 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- fpdfsdk/cpdfsdk_pageview.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'fpdfsdk/cpdfsdk_pageview.cpp') diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index aae245e298..c12673491c 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -43,16 +43,12 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv, m_bLocked(false), m_bBeingDestroyed(false) { CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm(); - if (pInterForm) { - CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); + CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); #ifdef PDF_ENABLE_XFA - if (page->GetPDFPage()) - pPDFInterForm->FixPageFields(page->GetPDFPage()); + if (page->GetPDFPage()) + pPDFInterForm->FixPageFields(page->GetPDFPage()); #else // PDF_ENABLE_XFA - pPDFInterForm->FixPageFields(page); -#endif // PDF_ENABLE_XFA - } -#ifndef PDF_ENABLE_XFA + pPDFInterForm->FixPageFields(page); m_page->SetView(this); #endif // PDF_ENABLE_XFA } @@ -358,8 +354,8 @@ bool CPDFSDK_PageView::OnMouseWheel(double deltaX, CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = m_pFormFillEnv->GetAnnotHandlerMgr(); - return pAnnotHandlerMgr->Annot_OnMouseWheel(this, &pAnnot, nFlag, (int)deltaY, - point); + return pAnnotHandlerMgr->Annot_OnMouseWheel(this, &pAnnot, nFlag, + static_cast(deltaY), point); } bool CPDFSDK_PageView::OnChar(int nChar, uint32_t nFlag) { -- cgit v1.2.3