summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2018-03-08 15:14:09 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-08 15:14:09 +0000
commit507fb4ed09d5fbc92fafdfe405d79d44d11a4664 (patch)
tree136d003fdefa3ad7fd707af180c161713108ffd2 /core/fpdfdoc/cpdf_formfield.cpp
parentf19255a1deec5f3ce804b08901abf7746e609bfe (diff)
downloadpdfium-507fb4ed09d5fbc92fafdfe405d79d44d11a4664.tar.xz
Convert Before{Selection|Value}Change to return a boolchromium/3366
Both of these IPDF_FormNotify methods return {-1, 0, 1} but all callsites only care about < 0 and >= 0. Convert to return a bool that treats the 0 and 1 case as the same. This also makse sense in terms of the API because false means validation failure. The case where 0 was used was a place holder for we didn't try for this field type, which also implicitly means validation passed. Change-Id: I0950c678191b83caffd755d4a87b2f0efee71c89 Reviewed-on: https://pdfium-review.googlesource.com/28192 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.cpp')
-rw-r--r--core/fpdfdoc/cpdf_formfield.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 686054f9f1..679acd1dc8 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -928,7 +928,7 @@ void CPDF_FormField::LoadDA() {
bool CPDF_FormField::NotifyBeforeSelectionChange(const WideString& value) {
if (!m_pForm->GetFormNotify())
return true;
- return m_pForm->GetFormNotify()->BeforeSelectionChange(this, value) >= 0;
+ return m_pForm->GetFormNotify()->BeforeSelectionChange(this, value);
}
void CPDF_FormField::NotifyAfterSelectionChange() {
@@ -940,7 +940,7 @@ void CPDF_FormField::NotifyAfterSelectionChange() {
bool CPDF_FormField::NotifyBeforeValueChange(const WideString& value) {
if (!m_pForm->GetFormNotify())
return true;
- return m_pForm->GetFormNotify()->BeforeValueChange(this, value) >= 0;
+ return m_pForm->GetFormNotify()->BeforeValueChange(this, value);
}
void CPDF_FormField::NotifyAfterValueChange() {