diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-05 14:19:16 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-05 19:45:49 +0000 |
commit | aebeec913f5571992896424aefce62b56dbb7e6f (patch) | |
tree | 764b48b2052a1ee6867c72a1b7cbf1ab0735a43c /core/fpdfdoc/cpdf_interform.cpp | |
parent | be912d78daf85619539daf12e4c659d54cb6e6fb (diff) | |
download | pdfium-aebeec913f5571992896424aefce62b56dbb7e6f.tar.xz |
Remove unused code from CPDF_InterForm
Change-Id: I8be34dc4bc5ace65f5f56eb062b53faf4c1a6986
Reviewed-on: https://pdfium-review.googlesource.com/22311
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_interform.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index e71e16cddd..281d4d33fc 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -370,22 +370,6 @@ bool RetrieveSpecificFont(uint8_t charSet, } #endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ -int CompareFieldName(const WideString& name1, const WideString& name2) { - const wchar_t* ptr1 = name1.c_str(); - const wchar_t* ptr2 = name2.c_str(); - if (name1.GetLength() == name2.GetLength()) - return name1 == name2 ? 1 : 0; - - size_t i = 0; - while (ptr1[i] == ptr2[i]) - i++; - if (i == name1.GetLength()) - return 2; - if (i == name2.GetLength()) - return 3; - return 0; -} - } // namespace class CFieldTree { @@ -799,64 +783,6 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(CPDF_Document* pDocument) { return pDocument ? AddNativeFont(GetNativeCharSet(), pDocument) : nullptr; } -bool CPDF_InterForm::ValidateFieldName( - WideString& csNewFieldName, - int iType, - const CPDF_FormField* pExcludedField, - const CPDF_FormControl* pExcludedControl) const { - if (csNewFieldName.IsEmpty()) - return false; - - int iPos = 0; - int iLength = csNewFieldName.GetLength(); - WideString csSub; - while (true) { - while (iPos < iLength && - (csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) { - iPos++; - } - if (iPos < iLength && !csSub.IsEmpty()) - csSub += L'.'; - while (iPos < iLength && csNewFieldName[iPos] != L'.') - csSub += csNewFieldName[iPos++]; - for (int i = csSub.GetLength() - 1; i > -1; i--) { - if (csSub[i] != L' ' && csSub[i] != L'.') - break; - - csSub.SetAt(i, L'\0'); - } - size_t dwCount = m_pFieldTree->m_Root.CountFields(); - for (size_t m = 0; m < dwCount; ++m) { - CPDF_FormField* pField = m_pFieldTree->m_Root.GetFieldAtIndex(m); - if (!pField) - continue; - if (pField == pExcludedField) { - if (!pExcludedControl || pField->CountControls() < 2) - continue; - } - WideString csFullName = pField->GetFullName(); - int iRet = CompareFieldName(csSub, csFullName); - if (iRet == 1) { - if (pField->GetFieldType() != iType) - return false; - } else if (iRet == 2 && csSub == csNewFieldName) { - if (csFullName[iPos] == L'.') - return false; - } else if (iRet == 3 && csSub == csNewFieldName) { - if (csNewFieldName[csFullName.GetLength()] == L'.') - return false; - } - } - if (iPos >= iLength) - break; - } - if (csSub.IsEmpty()) - return false; - - csNewFieldName = csSub; - return true; -} - size_t CPDF_InterForm::CountFields(const WideString& csFieldName) const { if (csFieldName.IsEmpty()) return m_pFieldTree->m_Root.CountFields(); |