summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_combobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_combobox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 055b697669..8aa656b856 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -74,7 +74,7 @@ bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot,
}
bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false);
+ auto* pWnd = static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false));
if (!pWnd)
return false;
@@ -250,12 +250,9 @@ void CFFL_ComboBox::OnSetFocus(CPWL_Edit* pEdit) {
WideString CFFL_ComboBox::GetSelectExportText() {
WideString swRet;
- int nExport = -1;
CPDFSDK_PageView* pPageView = GetCurPageView(true);
- if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, false)) {
- nExport = pComboBox->GetSelect();
- }
+ auto* pComboBox = static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false));
+ int nExport = pComboBox ? pComboBox->GetSelect() : -1;
if (nExport >= 0) {
if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) {