summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formcontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_formcontrol.cpp')
-rw-r--r--core/fpdfdoc/cpdf_formcontrol.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 7d4067b52f..5e24c5fb9e 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -101,10 +101,8 @@ ByteString CPDF_FormControl::GetCheckedAPState() {
ByteString csOn = GetOnStateName();
if (GetType() == CPDF_FormField::RadioButton ||
GetType() == CPDF_FormField::CheckBox) {
- if (ToArray(FPDF_GetFieldAttr(m_pField->GetDict(), "Opt"))) {
- int iIndex = m_pField->GetControlIndex(this);
- csOn.Format("%d", iIndex);
- }
+ if (ToArray(FPDF_GetFieldAttr(m_pField->GetDict(), "Opt")))
+ csOn = ByteString::Format("%d", m_pField->GetControlIndex(this));
}
if (csOn.IsEmpty())
csOn = "Yes";