From b2e6b4c44a38ea2ca9e021df31cd27eb67a45e35 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Aug 2018 20:53:58 +0000 Subject: Replace optional bool bNotify with enum type. Adds clarity to the call sites. Change-Id: Id4deed9adda2ad79f0847d618792429044d4f7d6 Reviewed-on: https://pdfium-review.googlesource.com/40351 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/formfiller/cffl_listbox.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/formfiller/cffl_listbox.cpp') diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp index bf24e116e5..c05400d13c 100644 --- a/fpdfsdk/formfiller/cffl_listbox.cpp +++ b/fpdfsdk/formfiller/cffl_listbox.cpp @@ -108,27 +108,32 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) { return; int32_t nNewTopIndex = pListBox->GetTopVisibleIndex(); - m_pWidget->ClearSelection(false); + m_pWidget->ClearSelection(NotificationOption::kDoNotNotify); 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); + if (pListBox->IsItemSelected(i)) { + m_pWidget->SetOptionSelection(i, true, + NotificationOption::kDoNotNotify); + } } } else { - m_pWidget->SetOptionSelection(pListBox->GetCurSel(), true, false); + m_pWidget->SetOptionSelection(pListBox->GetCurSel(), true, + NotificationOption::kDoNotNotify); } CPDFSDK_Widget::ObservedPtr observed_widget(m_pWidget.Get()); CFFL_ListBox::ObservedPtr observed_this(this); - m_pWidget->SetTopVisibleIndex(nNewTopIndex); if (!observed_widget) return; + m_pWidget->ResetFieldAppearance(true); if (!observed_widget) return; + m_pWidget->UpdateField(); if (!observed_widget || !observed_this) return; + SetChangeMark(); } -- cgit v1.2.3