summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_pageview.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-20 14:47:00 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-20 22:26:03 +0000
commit222e1a425e2d2199a842883dcc330a549f400630 (patch)
tree4d28a4fbf3856143ebebbe8b430062a25538bacf /fpdfsdk/cpdfsdk_pageview.cpp
parent995a601c50874729ac40e2cc444b8894cf2aea96 (diff)
downloadpdfium-222e1a425e2d2199a842883dcc330a549f400630.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_pageview.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp16
1 files changed, 6 insertions, 10 deletions
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<int>(deltaY), point);
}
bool CPDFSDK_PageView::OnChar(int nChar, uint32_t nFlag) {