| 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_radiobutton.h" | 7 #include "fpdfsdk/formfiller/cffl_radiobutton.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 uint32_t nChar, | 44 uint32_t nChar, |
| 45 uint32_t nFlags) { | 45 uint32_t nFlags) { |
| 46 switch (nChar) { | 46 switch (nChar) { |
| 47 case FWL_VKEY_Return: | 47 case FWL_VKEY_Return: |
| 48 case FWL_VKEY_Space: { | 48 case FWL_VKEY_Space: { |
| 49 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); | 49 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
| 50 ASSERT(pPageView); | 50 ASSERT(pPageView); |
| 51 | 51 |
| 52 FX_BOOL bReset = FALSE; | 52 FX_BOOL bReset = FALSE; |
| 53 FX_BOOL bExit = FALSE; | 53 FX_BOOL bExit = FALSE; |
| 54 m_pEnv->GetInteractiveFormFiller()->OnButtonUp(m_pWidget, pPageView, | 54 CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); |
| 55 m_pEnv->GetInteractiveFormFiller()->OnButtonUp(&pObserved, pPageView, |
| 55 bReset, bExit, nFlags); | 56 bReset, bExit, nFlags); |
| 56 if (bReset) | 57 if (!pObserved || bReset || bExit) |
| 57 return TRUE; | |
| 58 if (bExit) | |
| 59 return TRUE; | 58 return TRUE; |
| 60 | 59 |
| 61 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); | 60 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); |
| 62 | |
| 63 if (CPWL_RadioButton* pWnd = | 61 if (CPWL_RadioButton* pWnd = |
| 64 (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) | 62 (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) |
| 65 pWnd->SetCheck(TRUE); | 63 pWnd->SetCheck(TRUE); |
| 66 CommitData(pPageView, nFlags); | 64 CommitData(pPageView, nFlags); |
| 67 return TRUE; | 65 return TRUE; |
| 68 } | 66 } |
| 69 default: | 67 default: |
| 70 return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); | 68 return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); |
| 71 } | 69 } |
| 72 } | 70 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 110 } |
| 113 } | 111 } |
| 114 } | 112 } |
| 115 } | 113 } |
| 116 | 114 |
| 117 m_pWidget->SetCheck(bNewChecked, false); | 115 m_pWidget->SetCheck(bNewChecked, false); |
| 118 m_pWidget->UpdateField(); | 116 m_pWidget->UpdateField(); |
| 119 SetChangeMark(); | 117 SetChangeMark(); |
| 120 } | 118 } |
| 121 } | 119 } |
| OLD | NEW |