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>
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 2bf601d..f36afa6 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -532,19 +532,16 @@
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::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::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 @@
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 @@
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;
}