summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-07-21 17:42:19 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-22 00:54:57 +0000
commit60fa2fce1f6fc02b3039166d84ed8ec152312566 (patch)
treea5fe7c1263ccb1620b16b549787e390bb1814dd4 /fpdfsdk/cpdfsdk_formfillenvironment.h
parentd2be646ae1655ac702c5f304d546a2eb32ad2c54 (diff)
downloadpdfium-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_formfillenvironment.h')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index b1e095a0c2..c9937405bb 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -47,6 +47,16 @@ class CPDFSDK_FormFillEnvironment
FPDF_FORMFILLINFO* pFFinfo);
~CPDFSDK_FormFillEnvironment();
+ static bool IsSHIFTKeyDown(uint32_t nFlag) {
+ return !!(nFlag & FWL_EVENTFLAG_ShiftKey);
+ }
+ static bool IsCTRLKeyDown(uint32_t nFlag) {
+ return !!(nFlag & FWL_EVENTFLAG_ControlKey);
+ }
+ static bool IsALTKeyDown(uint32_t nFlag) {
+ return !!(nFlag & FWL_EVENTFLAG_AltKey);
+ }
+
CPDFSDK_PageView* GetPageView(UnderlyingPageType* pPage, bool renew);
CPDFSDK_PageView* GetPageView(int nIndex);
CPDFSDK_PageView* GetCurrentView();
@@ -74,8 +84,6 @@ class CPDFSDK_FormFillEnvironment
void SetChangeMark() { m_bChangeMask = true; }
void ClearChangeMark() { m_bChangeMask = false; }
- UnderlyingPageType* GetPage(int nIndex);
-
void ProcJavascriptFun();
bool ProcOpenAction();
@@ -88,11 +96,7 @@ class CPDFSDK_FormFillEnvironment
FX_SYSTEMTIME GetLocalTime() const;
void OnChange();
- bool IsSHIFTKeyDown(uint32_t nFlag) const;
- bool IsCTRLKeyDown(uint32_t nFlag) const;
- bool IsALTKeyDown(uint32_t nFlag) const;
- FPDF_PAGE GetPage(UnderlyingDocumentType* document, int nPageIndex);
FPDF_PAGE GetCurrentPage(UnderlyingDocumentType* document);
void ExecuteNamedAction(const char* namedAction);
@@ -214,6 +218,8 @@ class CPDFSDK_FormFillEnvironment
CPDFSDK_InterForm* GetInterForm(); // Creates if not present.
private:
+ UnderlyingPageType* GetPage(int nIndex);
+
FPDF_FORMFILLINFO* const m_pInfo;
std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr;
std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;