diff options
author | Lei Zhang <thestig@chromium.org> | 2017-07-21 17:42:19 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-22 00:54:57 +0000 |
commit | 60fa2fce1f6fc02b3039166d84ed8ec152312566 (patch) | |
tree | a5fe7c1263ccb1620b16b549787e390bb1814dd4 /fpdfsdk/cpdfsdk_annothandlermgr.cpp | |
parent | d2be646ae1655ac702c5f304d546a2eb32ad2c54 (diff) | |
download | pdfium-60fa2fce1f6fc02b3039166d84ed8ec152312566.tar.xz |
Simplify code in CPDFSDK_FormFillEnvironment.chromium/3165
This makes various IsFooKeyDown() methods static.
Transitively apply that to callers too.
Change-Id: Ia43b1fd62889c1943e0d8407e9696225b05125a8
Reviewed-on: https://pdfium-review.googlesource.com/7190
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_annothandlermgr.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_annothandlermgr.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp index 2b089e5185..9e649f6dc6 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp +++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp @@ -29,13 +29,13 @@ CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr( CPDFSDK_FormFillEnvironment* pFormFillEnv) : m_pBAAnnotHandler(pdfium::MakeUnique<CPDFSDK_BAAnnotHandler>()), - m_pWidgetHandler(pdfium::MakeUnique<CPDFSDK_WidgetHandler>(pFormFillEnv)), + m_pWidgetHandler(pdfium::MakeUnique<CPDFSDK_WidgetHandler>(pFormFillEnv)) #ifdef PDF_ENABLE_XFA + , m_pXFAWidgetHandler( - pdfium::MakeUnique<CPDFSDK_XFAWidgetHandler>(pFormFillEnv)), + pdfium::MakeUnique<CPDFSDK_XFAWidgetHandler>(pFormFillEnv)) #endif // PDF_ENABLE_XFA - m_pFormFillEnv(pFormFillEnv) { - m_pWidgetHandler->SetFormFiller(m_pFormFillEnv->GetInteractiveFormFiller()); +{ } CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() {} @@ -205,16 +205,16 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) { - if (m_pFormFillEnv->IsCTRLKeyDown(nFlag) || - m_pFormFillEnv->IsALTKeyDown(nFlag)) { + if (CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag) || + CPDFSDK_FormFillEnvironment::IsALTKeyDown(nFlag)) { return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag); } CPDFSDK_PageView* pPage = pAnnot->GetPageView(); CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot(); if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) { - CPDFSDK_Annot::ObservedPtr pNext( - GetNextAnnot(pFocusAnnot, !m_pFormFillEnv->IsSHIFTKeyDown(nFlag))); + CPDFSDK_Annot::ObservedPtr pNext(GetNextAnnot( + pFocusAnnot, !CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag))); if (pNext && pNext.Get() != pFocusAnnot) { pPage->GetFormFillEnv()->SetFocusAnnot(&pNext); return true; |