summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-13 18:41:17 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-14 13:22:51 +0000
commitc71de7fe009494675e56df5825b0e1ad3472c7d3 (patch)
treeab59a954974c7e326d1dd9a492e8209960a15f78 /fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
parenta7d2c15eff693a49b520b0ac8531620197c45ea5 (diff)
downloadpdfium-c71de7fe009494675e56df5825b0e1ad3472c7d3.tar.xz
Fix some nits in CFFL_InteractiveFormFiller.
Change-Id: I4c8ce920a4802b5b2ce3dc684cef271fc185feb0 Reviewed-on: https://pdfium-review.googlesource.com/6554 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_interactiveformfiller.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 2bf601d2f8..f36afa65d5 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -532,19 +532,16 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
float fPopupMax,
bool* bBottom,
float* fPopupRet) {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
+ CPDFSDK_Widget* pWidget = pData->pWidget;
+ auto* pPage = pWidget->GetPDFPage();
- CFX_FloatRect rcPageView(0, 0, 0, 0);
- rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth();
- rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
+ CFX_FloatRect rcPageView(0, pPage->GetPageHeight(), pPage->GetPageWidth(), 0);
rcPageView.Normalize();
- CFX_FloatRect rcAnnot = pData->pWidget->GetRect();
-
+ CFX_FloatRect rcAnnot = pWidget->GetRect();
float fTop = 0.0f;
float fBottom = 0.0f;
-
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pData->pWidget;
switch (pWidget->GetRotate() / 90) {
default:
case 0:
@@ -763,7 +760,7 @@ void CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Widget* pWidget,
void CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
bool& bExit,
uint32_t nFlag) {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
ASSERT(pData);
ASSERT(pData->pWidget);
@@ -777,7 +774,7 @@ void CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
void CFFL_InteractiveFormFiller::OnPopupPostOpen(void* pPrivateData,
bool& bExit,
uint32_t nFlag) {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
ASSERT(pData);
ASSERT(pData->pWidget);
@@ -874,7 +871,7 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
bool& bRC,
bool& bExit,
uint32_t nFlag) {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ CFFL_PrivateData* pData = reinterpret_cast<CFFL_PrivateData*>(pPrivateData);
ASSERT(pData->pWidget);
CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false);
@@ -927,7 +924,7 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
if (nAge != pData->pWidget->GetAppearanceAge()) {
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(
pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
- pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
+ pData = reinterpret_cast<CFFL_PrivateData*>(pWnd->GetAttachedData());
bExit = true;
}