summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio DeSouza <claudiomdsjr@gmail.com>2017-09-14 21:59:05 +0100
committerChromium commit bot <commit-bot@chromium.org>2017-09-14 21:35:22 +0000
commitf0947bd79c1c8e2bdddc97acb5b5e1cf7bd9164b (patch)
treeb3582762fdf064a5cd3eb5f108e6a4d3303cd2f2
parent753818af9dbb15a048703dffc11da0b87a2e243a (diff)
downloadpdfium-f0947bd79c1c8e2bdddc97acb5b5e1cf7bd9164b.tar.xz
Checkbox event fixed when triggered by a keyboard entry
The event was changed to behave in the same way as when reacting to a mouse click event. R=thestig@chromium.org Bug: pdfium:897 Change-Id: I14366d69ad309e00cb1dd78672870d1ee95007a9 Reviewed-on: https://pdfium-review.googlesource.com/13990 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--AUTHORS1
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp7
2 files changed, 6 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 8e17b654fc..0c84bf9ef5 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,6 +13,7 @@ Antonio Gomes <tonikitoo@igalia.com>
Brett Wilson <brettw@chromium.org>
Bruce Dawson <brucedawson@chromium.org>
Chery Cherian <cherycherian@gmail.com>
+Claudio DeSouza <claudiomdsjr@gmail.com>
Chris Palmer <palmer@chromium.org>
Dan Sinclair <dsinclair@chromium.org>
Felix Kauselmann <licorn@gmail.com>
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 1a3ccca547..9691f6dc6f 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -58,9 +58,12 @@ bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
}
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+
CPWL_CheckBox* pWnd = GetCheckBox(pPageView, true);
- if (pWnd)
- pWnd->SetCheck(!pWnd->IsChecked());
+ if (pWnd) {
+ CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ pWnd->SetCheck(!pWidget->IsChecked());
+ }
return CommitData(pPageView, nFlags);
}