Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: fpdfsdk/src/formfiller/FFL_CheckBox.cpp

Issue 1720043003: Remove foo != NULL outside of xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/include/formfiller/FFL_CheckBox.h" 7 #include "fpdfsdk/include/formfiller/FFL_CheckBox.h"
8 8
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h"
10 #include "fpdfsdk/include/fsdk_mgr.h" 10 #include "fpdfsdk/include/fsdk_mgr.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE); 93 CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE);
94 return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked(); 94 return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked();
95 } 95 }
96 96
97 void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) { 97 void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) {
98 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) { 98 if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) {
99 FX_BOOL bNewChecked = pWnd->IsChecked(); 99 FX_BOOL bNewChecked = pWnd->IsChecked();
100 100
101 if (bNewChecked) { 101 if (bNewChecked) {
102 CPDF_FormField* pField = m_pWidget->GetFormField(); 102 CPDF_FormField* pField = m_pWidget->GetFormField();
103 ASSERT(pField != NULL);
104
105 for (int32_t i = 0, sz = pField->CountControls(); i < sz; i++) { 103 for (int32_t i = 0, sz = pField->CountControls(); i < sz; i++) {
106 if (CPDF_FormControl* pCtrl = pField->GetControl(i)) { 104 if (CPDF_FormControl* pCtrl = pField->GetControl(i)) {
107 if (pCtrl->IsChecked()) { 105 if (pCtrl->IsChecked()) {
108 break; 106 break;
109 } 107 }
110 } 108 }
111 } 109 }
112 } 110 }
113 111
114 m_pWidget->SetCheck(bNewChecked, FALSE); 112 m_pWidget->SetCheck(bNewChecked, FALSE);
115 m_pWidget->UpdateField(); 113 m_pWidget->UpdateField();
116 SetChangeMark(); 114 SetChangeMark();
117 } 115 }
118 } 116 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698