diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-05-31 17:13:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-31 17:13:52 +0000 |
commit | 4023c874911d5fbc9d18a4f00e1e6b30ab0194ee (patch) | |
tree | 216752ba51f17ac12889d95dd01ca852a3cc171d /core | |
parent | d8126c2e72a60403c73f4187d4041364d45a8d61 (diff) | |
download | pdfium-4023c874911d5fbc9d18a4f00e1e6b30ab0194ee.tar.xz |
Remove uselesss code.
Change-Id: Id58d10dfb2bc51d3bd8b77fd71e7728823a542cf
Reviewed-on: https://pdfium-review.googlesource.com/33410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 83 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_interform.h | 4 |
2 files changed, 0 insertions, 87 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index ea408ec0df..c743e2b0a6 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -32,30 +32,6 @@ namespace { const int nMaxRecursion = 32; -const struct SupportFieldEncoding { - const char* m_name; - uint16_t m_codePage; -} g_fieldEncoding[] = { - {"BigFive", 950}, - {"GBK", 936}, - {"Shift-JIS", 932}, - {"UHC", 949}, -}; - -WideString GetFieldValue(const CPDF_Dictionary& pFieldDict, - const ByteString& bsEncoding) { - const ByteString csBValue = pFieldDict.GetStringFor("V"); - for (const auto& encoding : g_fieldEncoding) { - if (bsEncoding == encoding.m_name) - return WideString::FromCodePage(csBValue.AsStringView(), - encoding.m_codePage); - } - ByteString csTemp = csBValue.Left(2); - if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") - return PDF_DecodeText(csBValue); - return WideString::FromLocal(csBValue.AsStringView()); -} - void AddFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, @@ -1114,65 +1090,6 @@ std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF( return pDoc; } -void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, - const WideString& parent_name, - bool bNotify, - int nLevel) { - WideString name; - if (!parent_name.IsEmpty()) - name = parent_name + L"."; - - name += pFieldDict->GetUnicodeTextFor("T"); - CPDF_Array* pKids = pFieldDict->GetArrayFor("Kids"); - if (pKids) { - for (size_t i = 0; i < pKids->GetCount(); i++) { - CPDF_Dictionary* pKid = pKids->GetDictAt(i); - if (!pKid) - continue; - if (nLevel <= nMaxRecursion) - FDF_ImportField(pKid, name, bNotify, nLevel + 1); - } - return; - } - if (!pFieldDict->KeyExist("V")) - return; - - CPDF_FormField* pField = m_pFieldTree->GetField(name); - if (!pField) - return; - - WideString csWValue = GetFieldValue(*pFieldDict, m_bsEncoding); - FormFieldType fieldType = pField->GetFieldType(); - if (bNotify && m_pFormNotify) { - if (fieldType == FormFieldType::kListBox) { - if (!m_pFormNotify->BeforeSelectionChange(pField, csWValue)) - return; - } else if (fieldType == FormFieldType::kComboBox || - fieldType == FormFieldType::kTextField) { - if (!m_pFormNotify->BeforeValueChange(pField, csWValue)) - return; - } - } - pField->SetValue(csWValue); - CPDF_FormField::Type eType = pField->GetType(); - if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && - pFieldDict->KeyExist("Opt")) { - pField->SetOpt(pFieldDict->GetDirectObjectFor("Opt")->CloneDirectObject()); - } - - if (bNotify && m_pFormNotify) { - if (fieldType == FormFieldType::kCheckBox || - fieldType == FormFieldType::kRadioButton) { - m_pFormNotify->AfterCheckedStatusChange(pField); - } else if (fieldType == FormFieldType::kListBox) { - m_pFormNotify->AfterSelectionChange(pField); - } else if (fieldType == FormFieldType::kComboBox || - fieldType == FormFieldType::kTextField) { - m_pFormNotify->AfterValueChange(pField); - } - } -} - void CPDF_InterForm::SetFormNotify(IPDF_FormNotify* pNotify) { m_pFormNotify = pNotify; } diff --git a/core/fpdfdoc/cpdf_interform.h b/core/fpdfdoc/cpdf_interform.h index 796c336ea0..12c840f5f8 100644 --- a/core/fpdfdoc/cpdf_interform.h +++ b/core/fpdfdoc/cpdf_interform.h @@ -98,10 +98,6 @@ class CPDF_InterForm { void AddTerminalField(CPDF_Dictionary* pFieldDict); CPDF_FormControl* AddControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict); - void FDF_ImportField(CPDF_Dictionary* pField, - const WideString& parent_name, - bool bNotify = false, - int nLevel = 0); static bool s_bUpdateAP; |