diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-12 18:32:31 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-12 18:32:31 +0000 |
commit | 26177f27d4cf7191aa40da021424e820e8635e52 (patch) | |
tree | 7ed675ddecafc84004fa903c29b0861295f2f970 /core/fpdfdoc/cpdf_formfield.cpp | |
parent | f40380f454042c9783fe30260a0e3df8b32c5c92 (diff) | |
download | pdfium-26177f27d4cf7191aa40da021424e820e8635e52.tar.xz |
Slightly simplify CPDF_FormField's notify methods.
Change-Id: I5eaa286d8cd0920cfb73f3ca0dacc1800affc6b6
Reviewed-on: https://pdfium-review.googlesource.com/c/43936
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index a96e49b0cb..a076b150a8 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -883,27 +883,25 @@ void CPDF_FormField::LoadDA() { } bool CPDF_FormField::NotifyBeforeSelectionChange(const WideString& value) { - if (!m_pForm->GetFormNotify()) - return true; - return m_pForm->GetFormNotify()->BeforeSelectionChange(this, value); + auto* pNotify = m_pForm->GetFormNotify(); + return !pNotify || pNotify->BeforeSelectionChange(this, value); } void CPDF_FormField::NotifyAfterSelectionChange() { - if (!m_pForm->GetFormNotify()) - return; - m_pForm->GetFormNotify()->AfterSelectionChange(this); + auto* pNotify = m_pForm->GetFormNotify(); + if (pNotify) + pNotify->AfterSelectionChange(this); } bool CPDF_FormField::NotifyBeforeValueChange(const WideString& value) { - if (!m_pForm->GetFormNotify()) - return true; - return m_pForm->GetFormNotify()->BeforeValueChange(this, value); + auto* pNotify = m_pForm->GetFormNotify(); + return !pNotify || pNotify->BeforeValueChange(this, value); } void CPDF_FormField::NotifyAfterValueChange() { - if (!m_pForm->GetFormNotify()) - return; - m_pForm->GetFormNotify()->AfterValueChange(this); + auto* pNotify = m_pForm->GetFormNotify(); + if (pNotify) + pNotify->AfterValueChange(this); } bool CPDF_FormField::NotifyListOrComboBoxBeforeChange(const WideString& value) { |