Introduce CPDF_Array::Find().
Then implement Contains() in terms of Find(). Then use it in one place,
and avoid some casting.
Change-Id: I28225ca94c4544914aaac6a43c7661a7e30ab60f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/87390
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index bf23543..aef9db0 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -950,8 +950,8 @@
CPDFSDK_InteractiveForm* pRDForm = m_pFormFillEnv->GetInteractiveForm();
CPDF_InteractiveForm* pForm = pRDForm->GetInteractiveForm();
- return CJS_Result::Success(pRuntime->NewNumber(
- static_cast<int32_t>(pForm->FindFieldInCalculationOrder(pFormField))));
+ return CJS_Result::Success(
+ pRuntime->NewNumber(pForm->FindFieldInCalculationOrder(pFormField)));
}
CJS_Result CJS_Field::set_calc_order_index(CJS_Runtime* pRuntime,