diff options
Diffstat (limited to 'xfa/fxfa/cxfa_ffnotify.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffnotify.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index 36f860199a..a7cb91185b 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -41,8 +41,8 @@ namespace { -CXFA_FFListBox* ToListBox(CXFA_FFWidget* widget) { - return static_cast<CXFA_FFListBox*>(widget); +CXFA_FFDropDown* ToDropDown(CXFA_FFWidget* widget) { + return static_cast<CXFA_FFDropDown*>(widget); } CXFA_FFComboBox* ToComboBox(CXFA_FFWidget* widget) { @@ -71,12 +71,8 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_Node* pSender, CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { - if (pWidget->IsLoaded()) { - if (pSender->IsListBox()) - ToListBox(pWidget)->InsertItem(pLabel, iIndex); - else - ToComboBox(pWidget)->InsertItem(pLabel, iIndex); - } + if (pWidget->IsLoaded()) + ToDropDown(pWidget)->InsertItem(pLabel, iIndex); } } @@ -87,12 +83,8 @@ void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_Node* pSender, CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { - if (pWidget->IsLoaded()) { - if (pSender->IsListBox()) - ToListBox(pWidget)->DeleteItem(iIndex); - else - ToComboBox(pWidget)->DeleteItem(iIndex); - } + if (pWidget->IsLoaded()) + ToDropDown(pWidget)->DeleteItem(iIndex); } } |