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

Side by Side Diff: fpdfsdk/fsdk_baseform.cpp

Issue 1800793002: Modify xfa code to avoid c4800 warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 9 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/fpdfxfa/fpdfxfa_util.cpp ('k') | fpdfsdk/include/fpdfxfa/fpdfxfa_util.h » ('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/fsdk_baseform.h" 7 #include "fpdfsdk/include/fsdk_baseform.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 CPDF_FormControl* pFormControl) { 343 CPDF_FormControl* pFormControl) {
344 ASSERT(hWidget); 344 ASSERT(hWidget);
345 345
346 if (IXFA_WidgetHandler* pXFAWidgetHandler = pXFADocView->GetWidgetHandler()) { 346 if (IXFA_WidgetHandler* pXFAWidgetHandler = pXFADocView->GetWidgetHandler()) {
347 ASSERT(pFormControl); 347 ASSERT(pFormControl);
348 348
349 switch (pFormField->GetFieldType()) { 349 switch (pFormField->GetFieldType()) {
350 case FIELDTYPE_CHECKBOX: { 350 case FIELDTYPE_CHECKBOX: {
351 if (CXFA_WidgetAcc* pWidgetAcc = 351 if (CXFA_WidgetAcc* pWidgetAcc =
352 pXFAWidgetHandler->GetDataAcc(hWidget)) { 352 pXFAWidgetHandler->GetDataAcc(hWidget)) {
353 FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On; 353 pFormField->CheckControl(
354 354 pFormField->GetControlIndex(pFormControl),
355 pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), 355 pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true);
356 bChecked, TRUE);
357 } 356 }
358 } break; 357 } break;
359 case FIELDTYPE_RADIOBUTTON: { 358 case FIELDTYPE_RADIOBUTTON: {
359 // TODO(weili): Check whether we need to handle checkbox and radio
360 // button differently, otherwise, merge these two cases.
360 if (CXFA_WidgetAcc* pWidgetAcc = 361 if (CXFA_WidgetAcc* pWidgetAcc =
361 pXFAWidgetHandler->GetDataAcc(hWidget)) { 362 pXFAWidgetHandler->GetDataAcc(hWidget)) {
362 FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On; 363 pFormField->CheckControl(
363 364 pFormField->GetControlIndex(pFormControl),
364 pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), 365 pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true);
365 bChecked, TRUE);
366 } 366 }
367 } break; 367 } break;
368 case FIELDTYPE_TEXTFIELD: { 368 case FIELDTYPE_TEXTFIELD: {
369 if (CXFA_WidgetAcc* pWidgetAcc = 369 if (CXFA_WidgetAcc* pWidgetAcc =
370 pXFAWidgetHandler->GetDataAcc(hWidget)) { 370 pXFAWidgetHandler->GetDataAcc(hWidget)) {
371 CFX_WideString sValue; 371 CFX_WideString sValue;
372 pWidgetAcc->GetValue(sValue, XFA_VALUEPICTURE_Display); 372 pWidgetAcc->GetValue(sValue, XFA_VALUEPICTURE_Display);
373 pFormField->SetValue(sValue, TRUE); 373 pFormField->SetValue(sValue, TRUE);
374 } 374 }
375 } break; 375 } break;
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2863 break; 2863 break;
2864 } 2864 }
2865 } 2865 }
2866 } 2866 }
2867 2867
2868 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { 2868 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) {
2869 CFX_FloatRect rcAnnot; 2869 CFX_FloatRect rcAnnot;
2870 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); 2870 pAnnot->GetPDFAnnot()->GetRect(rcAnnot);
2871 return rcAnnot; 2871 return rcAnnot;
2872 } 2872 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_util.cpp ('k') | fpdfsdk/include/fpdfxfa/fpdfxfa_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698