Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "fpdfsdk/formfiller/cffl_checkbox.h" | 7 #include "fpdfsdk/formfiller/cffl_checkbox.h" |
| 8 | 8 |
| 9 #include "fpdfsdk/formfiller/cffl_formfiller.h" | 9 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
| 10 #include "fpdfsdk/include/cpdfsdk_environment.h" | 10 #include "fpdfsdk/include/cpdfsdk_environment.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 default: | 35 default: |
| 36 return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); | 36 return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, | 39 FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, |
| 40 uint32_t nChar, | 40 uint32_t nChar, |
| 41 uint32_t nFlags) { | 41 uint32_t nFlags) { |
| 42 switch (nChar) { | 42 switch (nChar) { |
| 43 case FWL_VKEY_Return: | 43 case FWL_VKEY_Return: |
| 44 case FWL_VKEY_Space: { | 44 case FWL_VKEY_Space: { |
| 45 CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); | 45 CFFL_InteractiveFormFiller* pInteractiveFormFiller = |
| 46 ASSERT(pIFormFiller); | 46 m_pEnv->GetInteractiveFormFiller(); |
| 47 ASSERT(pInteractiveFormFiller); | |
|
Tom Sepez
2016/09/21 18:15:30
nit: we'll segv at line 55, not sure this helps.
dsinclair
2016/09/21 18:34:01
Dropped the local all together.
| |
| 47 | 48 |
| 48 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); | 49 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
| 49 ASSERT(pPageView); | 50 ASSERT(pPageView); |
| 50 | 51 |
| 51 FX_BOOL bReset = FALSE; | 52 FX_BOOL bReset = FALSE; |
| 52 FX_BOOL bExit = FALSE; | 53 FX_BOOL bExit = FALSE; |
| 53 | 54 |
| 54 pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit, nFlags); | 55 pInteractiveFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit, |
| 56 nFlags); | |
| 55 | 57 |
| 56 if (bReset) | 58 if (bReset) |
| 57 return TRUE; | 59 return TRUE; |
| 58 if (bExit) | 60 if (bExit) |
| 59 return TRUE; | 61 return TRUE; |
| 60 | 62 |
| 61 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); | 63 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); |
| 62 | 64 |
| 63 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE)) | 65 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE)) |
| 64 pWnd->SetCheck(!pWnd->IsChecked()); | 66 pWnd->SetCheck(!pWnd->IsChecked()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 } | 110 } |
| 109 } | 111 } |
| 110 } | 112 } |
| 111 } | 113 } |
| 112 | 114 |
| 113 m_pWidget->SetCheck(bNewChecked, false); | 115 m_pWidget->SetCheck(bNewChecked, false); |
| 114 m_pWidget->UpdateField(); | 116 m_pWidget->UpdateField(); |
| 115 SetChangeMark(); | 117 SetChangeMark(); |
| 116 } | 118 } |
| 117 } | 119 } |
| OLD | NEW |