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>
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 1a3ccca..9691f6d 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -58,9 +58,12 @@
       }
 
       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);
     }