From 2d3a78547ae2a0c084dc312ca4b3e03ff3427a9f Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 25 May 2018 20:13:59 +0000 Subject: Remove CPDF_FormField::{Insert,Clear}Option It is not called anywhere. Change-Id: Ic5af010300a20fdd3d05f55df481030a946bb8c4 Reviewed-on: https://pdfium-review.googlesource.com/32971 Reviewed-by: Lei Zhang Commit-Queue: Lei Zhang --- core/fpdfdoc/cpdf_formfield.cpp | 51 ----------------------------------------- core/fpdfdoc/cpdf_formfield.h | 8 ------- 2 files changed, 59 deletions(-) diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index ae10b9e39d..bfc39b08f1 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -643,57 +643,6 @@ int CPDF_FormField::FindOptionValue(const WideString& csOptValue) const { return -1; } -#ifdef PDF_ENABLE_XFA -int CPDF_FormField::InsertOption(WideString csOptLabel, - int index, - bool bNotify) { - if (csOptLabel.IsEmpty()) - return -1; - - if (bNotify && !NotifyListOrComboBoxBeforeChange(csOptLabel)) - return -1; - - ByteString csStr = PDF_EncodeText(csOptLabel); - CPDF_Array* pOpt = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt")); - if (!pOpt) - pOpt = m_pDict->SetNewFor("Opt"); - - int iCount = pdfium::base::checked_cast(pOpt->GetCount()); - if (index >= iCount) { - pOpt->AddNew(csStr, false); - index = iCount; - } else { - pOpt->InsertNewAt(index, csStr, false); - } - - if (bNotify) - NotifyListOrComboBoxAfterChange(); - return index; -} - -bool CPDF_FormField::ClearOptions(bool bNotify) { - if (bNotify && m_pForm->GetFormNotify()) { - WideString csValue; - int iIndex = GetSelectedIndex(0); - if (iIndex >= 0) - csValue = GetOptionLabel(iIndex); - if (!NotifyListOrComboBoxBeforeChange(csValue)) - return false; - } - - m_pDict->RemoveFor("Opt"); - m_pDict->RemoveFor("V"); - m_pDict->RemoveFor("DV"); - m_pDict->RemoveFor("I"); - m_pDict->RemoveFor("TI"); - - if (bNotify) - NotifyListOrComboBoxAfterChange(); - - return true; -} -#endif // PDF_ENABLE_XFA - bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify) { diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index b79e430dee..315ca76a51 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -160,17 +160,9 @@ class CPDF_FormField { int GetSelectedOptionIndex(int index) const; bool IsOptionSelected(int iOptIndex) const; - bool SelectOption(int iOptIndex, bool bSelected, bool bNotify = false); - bool ClearSelectedOptions(bool bNotify = false); -#ifdef PDF_ENABLE_XFA - bool ClearOptions(bool bNotify = false); - - int InsertOption(WideString csOptLabel, int index = -1, bool bNotify = false); -#endif // PDF_ENABLE_XFA - float GetFontSize() const { return m_FontSize; } CPDF_Font* GetFont() const { return m_pFont.Get(); } -- cgit v1.2.3