| 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 "core/include/fpdfapi/cfdf_document.h" | 7 #include "core/include/fpdfapi/cfdf_document.h" |
| 8 #include "core/include/fpdfapi/cpdf_array.h" | 8 #include "core/include/fpdfapi/cpdf_array.h" |
| 9 #include "core/include/fpdfapi/cpdf_document.h" | 9 #include "core/include/fpdfapi/cpdf_document.h" |
| 10 #include "core/include/fpdfapi/cpdf_number.h" | 10 #include "core/include/fpdfapi/cpdf_number.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 CFX_WideString CPDF_FormField::GetFullName() { | 104 CFX_WideString CPDF_FormField::GetFullName() { |
| 105 return ::GetFullName(m_pDict); | 105 return ::GetFullName(m_pDict); |
| 106 } | 106 } |
| 107 FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify) { | 107 FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify) { |
| 108 switch (m_Type) { | 108 switch (m_Type) { |
| 109 case CPDF_FormField::CheckBox: | 109 case CPDF_FormField::CheckBox: |
| 110 case CPDF_FormField::RadioButton: { | 110 case CPDF_FormField::RadioButton: { |
| 111 int iCount = CountControls(); | 111 int iCount = CountControls(); |
| 112 if (iCount) { | 112 if (iCount) { |
| 113 // TODO(weili): Check whether anything special needs to be done for |
| 114 // unison field. Otherwise, merge these branches. |
| 113 if (PDF_FormField_IsUnison(this)) { | 115 if (PDF_FormField_IsUnison(this)) { |
| 114 for (int i = 0; i < iCount; i++) { | 116 for (int i = 0; i < iCount; i++) { |
| 115 CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE); | 117 CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE); |
| 116 } | 118 } |
| 117 } else { | 119 } else { |
| 118 for (int i = 0; i < iCount; i++) { | 120 for (int i = 0; i < iCount; i++) { |
| 119 CPDF_FormControl* pControl = GetControl(i); | 121 CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE); |
| 120 FX_BOOL bChecked = pControl->IsDefaultChecked(); | |
| 121 CheckControl(i, bChecked, FALSE); | |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 if (bNotify && m_pForm->m_pFormNotify) { | 125 if (bNotify && m_pForm->m_pFormNotify) { |
| 126 m_pForm->m_pFormNotify->AfterCheckedStatusChange(this); | 126 m_pForm->m_pFormNotify->AfterCheckedStatusChange(this); |
| 127 } | 127 } |
| 128 } break; | 128 } break; |
| 129 case CPDF_FormField::ComboBox: { | 129 case CPDF_FormField::ComboBox: { |
| 130 CFX_WideString csValue; | 130 CFX_WideString csValue; |
| 131 ClearSelection(); | 131 ClearSelection(); |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") | 1088 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") |
| 1089 ->GetDictBy("Font") | 1089 ->GetDictBy("Font") |
| 1090 ->GetDictBy(font_name); | 1090 ->GetDictBy(font_name); |
| 1091 | 1091 |
| 1092 if (!pFontDict) { | 1092 if (!pFontDict) { |
| 1093 return; | 1093 return; |
| 1094 } | 1094 } |
| 1095 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); | 1095 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); |
| 1096 m_FontSize = FX_atof(syntax.GetWord()); | 1096 m_FontSize = FX_atof(syntax.GetWord()); |
| 1097 } | 1097 } |
| OLD | NEW |