summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_listbox.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-21 13:47:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 13:47:58 -0700
commit3fea70cb133ca71c800482853473797a352ece16 (patch)
treee85b65ee89340caf5f1176bb8966ccff0b272925 /fpdfsdk/formfiller/cffl_listbox.cpp
parentbc1cbabe8d8bfa74d25160c14afa30d5b40df335 (diff)
downloadpdfium-3fea70cb133ca71c800482853473797a352ece16.tar.xz
Remove unused CFX_IntArray.
The only place its used, elements are added to it but the array is not used otherwise. Review URL: https://codereview.chromium.org/1906133002
Diffstat (limited to 'fpdfsdk/formfiller/cffl_listbox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp47
1 files changed, 16 insertions, 31 deletions
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index b668b67edb..dc4f07d0d2 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -111,40 +111,25 @@ FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
}
void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget);
-
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
- CFX_IntArray aOldSelect, aNewSelect;
-
- {
- for (int i = 0, sz = m_pWidget->CountOptions(); i < sz; i++) {
- if (m_pWidget->IsOptionSelected(i)) {
- aOldSelect.Add(i);
- }
- }
- }
-
- int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
-
- m_pWidget->ClearSelection(FALSE);
+ CPWL_ListBox* pListBox =
+ static_cast<CPWL_ListBox*>(GetPDFWindow(pPageView, FALSE));
+ if (!pListBox)
+ return;
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
- for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
- if (pListBox->IsItemSelected(i)) {
- m_pWidget->SetOptionSelection(i, TRUE, FALSE);
- aNewSelect.Add(i);
- }
- }
- } else {
- m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
- aNewSelect.Add(pListBox->GetCurSel());
+ int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
+ m_pWidget->ClearSelection(FALSE);
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
+ for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
+ if (pListBox->IsItemSelected(i))
+ m_pWidget->SetOptionSelection(i, TRUE, FALSE);
}
-
- m_pWidget->SetTopVisibleIndex(nNewTopIndex);
- m_pWidget->ResetFieldAppearance(TRUE);
- m_pWidget->UpdateField();
- SetChangeMark();
+ } else {
+ m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
}
+ m_pWidget->SetTopVisibleIndex(nNewTopIndex);
+ m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
}
void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,