diff options
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 11 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_impl.cpp | 9 | ||||
-rw-r--r-- | fxjs/cjs_field.cpp | 10 |
3 files changed, 9 insertions, 21 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index df59369723..686054f9f1 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -168,14 +168,9 @@ bool CPDF_FormField::ResetField(bool bNotify) { int iCount = CountControls(); if (iCount) { // TODO(weili): Check whether anything special needs to be done for - // unison field. Otherwise, merge these branches. - if (IsUnison(this)) { - for (int i = 0; i < iCount; i++) - CheckControl(i, GetControl(i)->IsDefaultChecked(), false); - } else { - for (int i = 0; i < iCount; i++) - CheckControl(i, GetControl(i)->IsDefaultChecked(), false); - } + // unison field. (When IsUnison(this) returns true/false.) + for (int i = 0; i < iCount; i++) + CheckControl(i, GetControl(i)->IsDefaultChecked(), false); } if (bNotify && m_pForm->GetFormNotify()) m_pForm->GetFormNotify()->AfterCheckedStatusChange(this); diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp index a2a7b1dddf..1881ba2c28 100644 --- a/fpdfsdk/pwl/cpwl_edit_impl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp @@ -1576,13 +1576,8 @@ bool CPWL_EditImpl::Backspace(bool bAddUndo, bool bPaint) { return false; if (bAddUndo && m_bEnableUndo) { - if (m_wpCaret.nSecIndex != m_wpOldCaret.nSecIndex) { - AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>( - this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset)); - } else { - AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>( - this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset)); - } + AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>( + this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset)); } if (bPaint) { RearrangePart(CPVT_WordRange(m_wpCaret, m_wpOldCaret)); diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp index 0f06be0091..7f530cf4d8 100644 --- a/fxjs/cjs_field.cpp +++ b/fxjs/cjs_field.cpp @@ -2320,12 +2320,10 @@ CJS_Return Field::checkThisBox( } if (nWidget < 0 || nWidget >= pFormField->CountControls()) return CJS_Return(false); - // TODO(weili): Check whether anything special needed for radio button, - // otherwise merge these branches. - if (pFormField->GetFieldType() == FormFieldType::kRadioButton) - pFormField->CheckControl(nWidget, bCheckit, true); - else - pFormField->CheckControl(nWidget, bCheckit, true); + + // TODO(weili): Check whether anything special needed for radio button. + // (When pFormField->GetFieldType() == FormFieldType::kRadioButton.) + pFormField->CheckControl(nWidget, bCheckit, true); UpdateFormField(m_pFormFillEnv.Get(), pFormField, true, true, true); return CJS_Return(true); |