| Index: core/src/fpdfdoc/doc_form.cpp
|
| diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
|
| index 9f949cc96589b70dc1c3503e96608eb6c8bd0942..c49f042b32486e6f679d37ab9c422e1be0550572 100644
|
| --- a/core/src/fpdfdoc/doc_form.cpp
|
| +++ b/core/src/fpdfdoc/doc_form.cpp
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "core/include/fpdfdoc/fpdf_doc.h"
|
| #include "doc_utils.h"
|
| +#include "third_party/base/stl_util.h"
|
|
|
| const int nMaxRecursion = 32;
|
|
|
| @@ -831,8 +832,7 @@ bool CPDF_InterForm::ResetForm(const std::vector<CPDF_FormField*>& fields,
|
| if (!pField)
|
| continue;
|
|
|
| - auto it = std::find(fields.begin(), fields.end(), pField);
|
| - if (bIncludeOrExclude == (it != fields.end()))
|
| + if (bIncludeOrExclude == pdfium::ContainsValue(fields, pField))
|
| pField->ResetField(bNotify);
|
| }
|
| if (bNotify && m_pFormNotify)
|
| @@ -1004,10 +1004,8 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(
|
| continue;
|
|
|
| bool bFind = true;
|
| - if (fields) {
|
| - auto it = std::find(fields->begin(), fields->end(), pField);
|
| - bFind = (it != fields->end());
|
| - }
|
| + if (fields)
|
| + bFind = pdfium::ContainsValue(*fields, pField);
|
| if (bIncludeOrExclude == bFind) {
|
| CPDF_Dictionary* pFieldDict = pField->m_pDict;
|
| if ((dwFlags & 0x02) != 0 && pFieldDict->GetString("V").IsEmpty()) {
|
| @@ -1060,8 +1058,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
|
| if (dwFlags & 0x04)
|
| continue;
|
|
|
| - auto it = std::find(fields.begin(), fields.end(), pField);
|
| - if (bIncludeOrExclude == (it != fields.end())) {
|
| + if (bIncludeOrExclude == pdfium::ContainsValue(fields, pField)) {
|
| if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetString("V").IsEmpty())
|
| continue;
|
|
|
|
|