Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: fpdfsdk/formfiller/cffl_listbox.cpp

Issue 1906133002: Remove unused CFX_IntArray. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: static_cast Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/fsdk_baseannot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cffl_listbox.cpp
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index b668b67edb0dc07e9488d86535db95f985fce528..dc4f07d0d20bc29e7df3d5fa5625094286eef4b0 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,
« no previous file with comments | « no previous file | fpdfsdk/fsdk_baseannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698