summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-16 20:53:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-16 20:53:58 +0000
commitb2e6b4c44a38ea2ca9e021df31cd27eb67a45e35 (patch)
tree8e9392c73c3905d38d9e9e636adf8df9c7af072e /fpdfsdk/cpdfsdk_widget.cpp
parentaa987a9a895d42749c0f5e4092618fe7ded6667e (diff)
downloadpdfium-b2e6b4c44a38ea2ca9e021df31cd27eb67a45e35.tar.xz
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 <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index f9fdef829b..8bd1f10177 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -526,44 +526,45 @@ int CPDFSDK_Widget::GetMaxLen() const {
return pFormField->GetMaxLen();
}
-void CPDFSDK_Widget::SetCheck(bool bChecked, bool bNotify) {
+void CPDFSDK_Widget::SetCheck(bool bChecked, NotificationOption notify) {
CPDF_FormControl* pFormCtrl = GetFormControl();
CPDF_FormField* pFormField = pFormCtrl->GetField();
pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked,
- bNotify);
+ notify);
#ifdef PDF_ENABLE_XFA
if (!IsWidgetAppearanceValid(CPDF_Annot::Normal))
ResetAppearance(true);
- if (!bNotify)
+ if (notify == NotificationOption::kDoNotNotify)
Synchronize(true);
#endif // PDF_ENABLE_XFA
}
-void CPDFSDK_Widget::SetValue(const WideString& sValue, bool bNotify) {
+void CPDFSDK_Widget::SetValue(const WideString& sValue,
+ NotificationOption notify) {
CPDF_FormField* pFormField = GetFormField();
- pFormField->SetValue(sValue, bNotify);
+ pFormField->SetValue(sValue, notify);
#ifdef PDF_ENABLE_XFA
- if (!bNotify)
+ if (notify == NotificationOption::kDoNotNotify)
Synchronize(true);
#endif // PDF_ENABLE_XFA
}
void CPDFSDK_Widget::SetOptionSelection(int index,
bool bSelected,
- bool bNotify) {
+ NotificationOption notify) {
CPDF_FormField* pFormField = GetFormField();
- pFormField->SetItemSelection(index, bSelected, bNotify);
+ pFormField->SetItemSelection(index, bSelected, notify);
#ifdef PDF_ENABLE_XFA
- if (!bNotify)
+ if (notify == NotificationOption::kDoNotNotify)
Synchronize(true);
#endif // PDF_ENABLE_XFA
}
-void CPDFSDK_Widget::ClearSelection(bool bNotify) {
+void CPDFSDK_Widget::ClearSelection(NotificationOption notify) {
CPDF_FormField* pFormField = GetFormField();
- pFormField->ClearSelection(bNotify);
+ pFormField->ClearSelection(notify);
#ifdef PDF_ENABLE_XFA
- if (!bNotify)
+ if (notify == NotificationOption::kDoNotNotify)
Synchronize(true);
#endif // PDF_ENABLE_XFA
}