| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |