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/cpdfsdk_formfillenvironment.h" | 9 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
10 #include "fpdfsdk/cpdfsdk_widget.h" | 10 #include "fpdfsdk/cpdfsdk_widget.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 uint32_t nFlags) { | 42 uint32_t nFlags) { |
43 switch (nChar) { | 43 switch (nChar) { |
44 case FWL_VKEY_Return: | 44 case FWL_VKEY_Return: |
45 case FWL_VKEY_Space: { | 45 case FWL_VKEY_Space: { |
46 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); | 46 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
47 ASSERT(pPageView); | 47 ASSERT(pPageView); |
48 | 48 |
49 FX_BOOL bReset = FALSE; | 49 FX_BOOL bReset = FALSE; |
50 FX_BOOL bExit = FALSE; | 50 FX_BOOL bExit = FALSE; |
51 CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); | 51 CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); |
52 m_pEnv->GetInteractiveFormFiller()->OnButtonUp(&pObserved, pPageView, | 52 m_pFormFillEnv->GetInteractiveFormFiller()->OnButtonUp( |
53 bReset, bExit, nFlags); | 53 &pObserved, pPageView, bReset, bExit, nFlags); |
54 if (!pObserved) { | 54 if (!pObserved) { |
55 m_pWidget = nullptr; | 55 m_pWidget = nullptr; |
56 return TRUE; | 56 return TRUE; |
57 } | 57 } |
58 if (bReset || bExit) | 58 if (bReset || bExit) |
59 return TRUE; | 59 return TRUE; |
60 | 60 |
61 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); | 61 CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); |
62 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE)) | 62 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE)) |
63 pWnd->SetCheck(!pWnd->IsChecked()); | 63 pWnd->SetCheck(!pWnd->IsChecked()); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 } | 108 } |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 m_pWidget->SetCheck(bNewChecked, false); | 112 m_pWidget->SetCheck(bNewChecked, false); |
113 m_pWidget->UpdateField(); | 113 m_pWidget->UpdateField(); |
114 SetChangeMark(); | 114 SetChangeMark(); |
115 } | 115 } |
116 } | 116 } |
OLD | NEW |