diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-11-23 09:13:33 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-11-23 09:13:33 -0800 |
commit | b4f00291e3dbf0b067fd8e1c40194a5a30d89b1f (patch) | |
tree | ca086507892838937d6cf4b036a1c35c7f76f251 /fpdfsdk/src | |
parent | 5a2374a8ac83cffb072c86d2e8825912a37d0a12 (diff) | |
download | pdfium-b4f00291e3dbf0b067fd8e1c40194a5a30d89b1f.tar.xz |
Merge to XFA: Replace |CPWL_ComboBox::operator CPWL_Edit()|.
Original Review URL: https://codereview.chromium.org/1467653002 .
(cherry picked from commit 54bc568bb41c5c258e95c24ef9d7355dcdc20f9e)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1466743003 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_ComboBox.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index d4a93aaf3c..348d5d14d2 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -137,8 +137,8 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView, switch (type) { case CPDF_AAction::KeyStroke: if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { fa.bFieldFull = pEdit->IsTextFull(); int nSelStart = 0; int nSelEnd = 0; @@ -157,8 +157,8 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView, break; case CPDF_AAction::Validate: if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { fa.sValue = pEdit->GetText(); } } @@ -179,8 +179,8 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, switch (type) { case CPDF_AAction::KeyStroke: if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { pEdit->SetSel(fa.nSelStart, fa.nSelEnd); pEdit->ReplaceSel(fa.sChange.c_str()); } @@ -210,10 +210,10 @@ void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) { ASSERT(pPageView != NULL); if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) { m_State.nIndex = pComboBox->GetSelect(); - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { pEdit->GetSel(m_State.nStart, m_State.nEnd); m_State.sValue = pEdit->GetText(); } @@ -224,11 +224,11 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) { ASSERT(pPageView != NULL); if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE)) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, TRUE))) { if (m_State.nIndex >= 0) pComboBox->SetSelect(m_State.nIndex); else { - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { pEdit->SetText(m_State.sValue.c_str()); pEdit->SetSel(m_State.nStart, m_State.nEnd); } @@ -258,12 +258,10 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { if (CPWL_ComboBox* pComboBox = - (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { - if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { + static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) { + if (CPWL_Edit* pEdit = pComboBox->GetEdit()) return pEdit->IsTextFull(); - } } - return FALSE; } |