summaryrefslogtreecommitdiff
path: root/fxjs/cjs_publicmethods.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-26 18:19:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-26 18:19:14 +0000
commit9141116074f9209f617d9607e747c8947c952c46 (patch)
tree357fd20af9fac3fee0c8bd1dc76f58bb51acdbae /fxjs/cjs_publicmethods.cpp
parent1dbea185e70973739d58b11b0e46bd361d6cf0d5 (diff)
downloadpdfium-9141116074f9209f617d9607e747c8947c952c46.tar.xz
Fixup AFSimple_Calculate indexing bug
The refactoring in [1] introduced a bug where we pulled the wrong array index to get the array of fields to use in the AFSimple_Calculate method. This caused the calculation to not be performed as the fields could not be found. This CL fixes up the index and adds a test to verify we use AFSimple_Calucate to sum two fields. 1- https://pdfium-review.googlesource.com/c/pdfium/+/16670 Bug: chromium:811913 Change-Id: I2abb9fe4fe2d6969ce1876736faadf252ef90575 Reviewed-on: https://pdfium-review.googlesource.com/27670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxjs/cjs_publicmethods.cpp')
-rw-r--r--fxjs/cjs_publicmethods.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index 30927beac2..74428c3724 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -1587,7 +1587,7 @@ CJS_Return CJS_PublicMethods::AFSimple_Calculate(
double dValue = wcscmp(sFunction.c_str(), L"PRD") == 0 ? 1.0 : 0.0;
v8::Local<v8::Array> FieldNameArray =
- AF_MakeArrayFromList(pRuntime, params[0]);
+ AF_MakeArrayFromList(pRuntime, params[1]);
int nFieldsCount = 0;
for (size_t i = 0; i < pRuntime->GetArrayLength(FieldNameArray); ++i) {
WideString wsFieldName =