summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_button.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp4
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp3
4 files changed, 5 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_button.cpp b/fpdfsdk/formfiller/cffl_button.cpp
index dab0045373..ea2315d5a6 100644
--- a/fpdfsdk/formfiller/cffl_button.cpp
+++ b/fpdfsdk/formfiller/cffl_button.cpp
@@ -64,7 +64,7 @@ void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView,
CFX_RenderDevice* pDevice,
const CFX_Matrix& mtUser2Device) {
ASSERT(pPageView);
- CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
CPDF_FormControl* pCtrl = pWidget->GetFormControl();
if (pCtrl->GetHighlightingMode() != CPDF_FormControl::Push) {
pWidget->DrawAppearance(pDevice, mtUser2Device, CPDF_Annot::Normal,
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index e9c72efd39..57119c5c31 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -61,7 +61,7 @@ bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
CPWL_CheckBox* pWnd = GetCheckBox(pPageView, true);
if (pWnd) {
- CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
pWnd->SetCheck(!pWidget->IsChecked());
}
@@ -83,7 +83,7 @@ bool CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPWL_CheckBox* pWnd = GetCheckBox(pPageView, true);
if (pWnd) {
- CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
pWnd->SetCheck(!pWidget->IsChecked());
}
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 94592e719f..85f53469e3 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -291,7 +291,7 @@ bool CFFL_FormFiller::Redo(CPDFSDK_Annot* pAnnot) {
}
void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
- auto* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
IPDF_Page* pPage = pWidget->GetPage();
CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(pPage, true);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index d73aaf93b3..c1cc355156 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -58,7 +58,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
ASSERT(pPageView);
- CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
if (!IsVisible(pWidget))
return;
@@ -66,7 +66,6 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
if (pFormFiller && pFormFiller->IsValid()) {
pFormFiller->OnDraw(pPageView, pAnnot, pDevice, *pUser2Device);
pAnnot->GetPDFPage();
-
if (m_pFormFillEnv->GetFocusAnnot() != pAnnot)
return;