Remove always-kDoNotNotify arguments from CPDFSDK_Widget
Change-Id: I30deb87bc6acede29da76526e48779176b49d5bb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/79513
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index af01f0c..12d9581 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -516,45 +516,39 @@
return pFormField->GetMaxLen();
}
-void CPDFSDK_Widget::SetCheck(bool bChecked, NotificationOption notify) {
+void CPDFSDK_Widget::SetCheck(bool bChecked) {
CPDF_FormControl* pFormCtrl = GetFormControl();
CPDF_FormField* pFormField = pFormCtrl->GetField();
pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked,
- notify);
+ NotificationOption::kDoNotNotify);
#ifdef PDF_ENABLE_XFA
if (!IsWidgetAppearanceValid(CPDF_Annot::Normal))
ResetXFAAppearance(true);
- if (notify == NotificationOption::kDoNotNotify)
- Synchronize(true);
+ Synchronize(true);
#endif // PDF_ENABLE_XFA
}
-void CPDFSDK_Widget::SetValue(const WideString& sValue,
- NotificationOption notify) {
+void CPDFSDK_Widget::SetValue(const WideString& sValue) {
CPDF_FormField* pFormField = GetFormField();
- pFormField->SetValue(sValue, notify);
+ pFormField->SetValue(sValue, NotificationOption::kDoNotNotify);
#ifdef PDF_ENABLE_XFA
- if (notify == NotificationOption::kDoNotNotify)
- Synchronize(true);
+ Synchronize(true);
#endif // PDF_ENABLE_XFA
}
-void CPDFSDK_Widget::SetOptionSelection(int index,
- NotificationOption notify) {
+void CPDFSDK_Widget::SetOptionSelection(int index) {
CPDF_FormField* pFormField = GetFormField();
- pFormField->SetItemSelection(index, notify);
+ pFormField->SetItemSelection(index, NotificationOption::kDoNotNotify);
#ifdef PDF_ENABLE_XFA
- if (notify == NotificationOption::kDoNotNotify)
- Synchronize(true);
+ Synchronize(true);
#endif // PDF_ENABLE_XFA
}
-void CPDFSDK_Widget::ClearSelection(NotificationOption notify) {
+void CPDFSDK_Widget::ClearSelection() {
CPDF_FormField* pFormField = GetFormField();
- pFormField->ClearSelection(notify);
+ pFormField->ClearSelection(NotificationOption::kDoNotNotify);
#ifdef PDF_ENABLE_XFA
- if (notify == NotificationOption::kDoNotNotify)
- Synchronize(true);
+ Synchronize(true);
#endif // PDF_ENABLE_XFA
}
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 42d914a..9c12d2a 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -75,10 +75,10 @@
int GetAlignment() const;
int GetMaxLen() const;
- void SetCheck(bool bChecked, NotificationOption notify);
- void SetValue(const WideString& sValue, NotificationOption notify);
- void SetOptionSelection(int index, NotificationOption notify);
- void ClearSelection(NotificationOption notify);
+ void SetCheck(bool bChecked);
+ void SetValue(const WideString& sValue);
+ void SetOptionSelection(int index);
+ void ClearSelection();
void SetTopVisibleIndex(int index);
#ifdef PDF_ENABLE_XFA
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 4b0c6ef..c2d26db 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -117,7 +117,7 @@
}
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_CheckBox> observed_this(this);
- m_pWidget->SetCheck(bNewChecked, NotificationOption::kDoNotNotify);
+ m_pWidget->SetCheck(bNewChecked);
if (!observed_widget)
return;
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 7a8a1e1..75aa2f0 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -99,10 +99,10 @@
bSetValue = (nCurSel < 0) || (swText != m_pWidget->GetOptionLabel(nCurSel));
if (bSetValue) {
- m_pWidget->SetValue(swText, NotificationOption::kDoNotNotify);
+ m_pWidget->SetValue(swText);
} else {
m_pWidget->GetSelectedIndex(0);
- m_pWidget->SetOptionSelection(nCurSel, NotificationOption::kDoNotNotify);
+ m_pWidget->SetOptionSelection(nCurSel);
}
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_ComboBox> observed_this(this);
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 29cd452..f60d571 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -110,15 +110,14 @@
return;
int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
- m_pWidget->ClearSelection(NotificationOption::kDoNotNotify);
+ m_pWidget->ClearSelection();
if (m_pWidget->GetFieldFlags() & pdfium::form_flags::kChoiceMultiSelect) {
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
if (pListBox->IsItemSelected(i))
- m_pWidget->SetOptionSelection(i, NotificationOption::kDoNotNotify);
+ m_pWidget->SetOptionSelection(i);
}
} else {
- m_pWidget->SetOptionSelection(pListBox->GetCurSel(),
- NotificationOption::kDoNotNotify);
+ m_pWidget->SetOptionSelection(pListBox->GetCurSel());
}
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_ListBox> observed_this(this);
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index ff0cce9..2e1dfcd 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -106,7 +106,7 @@
}
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_RadioButton> observed_this(this);
- m_pWidget->SetCheck(bNewChecked, NotificationOption::kDoNotNotify);
+ m_pWidget->SetCheck(bNewChecked);
if (!observed_widget)
return;
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 13bd411..c2cdca7 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -155,7 +155,7 @@
WideString sNewValue = pWnd->GetText();
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_TextField> observed_this(this);
- m_pWidget->SetValue(sNewValue, NotificationOption::kDoNotNotify);
+ m_pWidget->SetValue(sNewValue);
if (!observed_widget)
return;