summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.cpp
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.cpp
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.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index de7947556d..5c847fc1df 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -289,25 +289,6 @@ void CPDFSDK_FormFillEnvironment::OnChange() {
m_pInfo->FFI_OnChange(m_pInfo);
}
-bool CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(uint32_t nFlag) const {
- return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
-}
-
-bool CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(uint32_t nFlag) const {
- return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
-}
-
-bool CPDFSDK_FormFillEnvironment::IsALTKeyDown(uint32_t nFlag) const {
- return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
-}
-
-FPDF_PAGE CPDFSDK_FormFillEnvironment::GetPage(UnderlyingDocumentType* document,
- int nPageIndex) {
- if (m_pInfo && m_pInfo->FFI_GetPage)
- return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
- return nullptr;
-}
-
FPDF_PAGE CPDFSDK_FormFillEnvironment::GetCurrentPage(
UnderlyingDocumentType* document) {
if (m_pInfo && m_pInfo->FFI_GetCurrentPage)
@@ -589,8 +570,7 @@ CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetCurrentView() {
}
CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetPageView(int nIndex) {
- UnderlyingPageType* pTempPage =
- UnderlyingFromFPDFPage(GetPage(m_pUnderlyingDoc.Get(), nIndex));
+ UnderlyingPageType* pTempPage = GetPage(nIndex);
if (!pTempPage)
return nullptr;
@@ -663,7 +643,10 @@ void CPDFSDK_FormFillEnvironment::RemovePageView(
}
UnderlyingPageType* CPDFSDK_FormFillEnvironment::GetPage(int nIndex) {
- return UnderlyingFromFPDFPage(GetPage(m_pUnderlyingDoc.Get(), nIndex));
+ if (!m_pInfo || !m_pInfo->FFI_GetPage)
+ return nullptr;
+ return UnderlyingFromFPDFPage(
+ m_pInfo->FFI_GetPage(m_pInfo, m_pUnderlyingDoc.Get(), nIndex));
}
CPDFSDK_InterForm* CPDFSDK_FormFillEnvironment::GetInterForm() {