diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-12 18:31:51 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-12 18:31:51 +0000 |
commit | f40380f454042c9783fe30260a0e3df8b32c5c92 (patch) | |
tree | d89f89ee2f813e490ec0ccd5c6195c041f81ab44 /core/fpdfdoc/cpdf_formfield.cpp | |
parent | 8273b37f032a2d9e8e4a83eeda43641365f311a2 (diff) | |
download | pdfium-f40380f454042c9783fe30260a0e3df8b32c5c92.tar.xz |
Rename CPDF_{Array,Dictionary}::GetCount() to size().
Make them compatible with pdfium::CollectionSize().
Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157
Reviewed-on: https://pdfium-review.googlesource.com/c/43937
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index 8399e79a13..a96e49b0cb 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -443,7 +443,7 @@ int CPDF_FormField::CountSelectedItems() const { if (pValue->IsString() || pValue->IsNumber()) return pValue->GetString().IsEmpty() ? 0 : 1; const CPDF_Array* pArray = pValue->AsArray(); - return pArray ? pArray->GetCount() : 0; + return pArray ? pArray->size() : 0; } int CPDF_FormField::GetSelectedIndex(int index) const { @@ -533,7 +533,7 @@ bool CPDF_FormField::IsItemSelected(int index) const { break; } } - for (int i = 0; i < static_cast<int>(pArray->GetCount()); i++) + for (int i = 0; i < static_cast<int>(pArray->size()); i++) if (pArray->GetDirectObjectAt(i)->GetUnicodeText() == opt_value && i == iPos) { return true; @@ -588,7 +588,7 @@ bool CPDF_FormField::SetItemSelection(int index, pArray->AddNew<CPDF_String>(PDF_EncodeText(opt_value), false); } } - if (pArray->GetCount() > 0) + if (pArray->size() > 0) m_pDict->SetFor("V", std::move(pArray)); } } else { @@ -627,7 +627,7 @@ int CPDF_FormField::GetDefaultSelectedItem() const { int CPDF_FormField::CountOptions() const { const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt")); - return pArray ? pArray->GetCount() : 0; + return pArray ? pArray->size() : 0; } WideString CPDF_FormField::GetOptionText(int index, int sub_index) const { @@ -767,7 +767,7 @@ int CPDF_FormField::GetTopVisibleIndex() const { int CPDF_FormField::CountSelectedOptions() const { const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "I")); - return pArray ? pArray->GetCount() : 0; + return pArray ? pArray->size() : 0; } int CPDF_FormField::GetSelectedOptionIndex(int index) const { @@ -775,7 +775,7 @@ int CPDF_FormField::GetSelectedOptionIndex(int index) const { if (!pArray) return -1; - int iCount = pArray->GetCount(); + int iCount = pArray->size(); if (iCount < 0 || index >= iCount) return -1; return pArray->GetIntegerAt(index); @@ -805,7 +805,7 @@ bool CPDF_FormField::SelectOption(int iOptIndex, } bool bReturn = false; - for (size_t i = 0; i < pArray->GetCount(); i++) { + for (size_t i = 0; i < pArray->size(); i++) { int iFind = pArray->GetIntegerAt(i); if (iFind == iOptIndex) { if (bSelected) |