From 9141116074f9209f617d9607e747c8947c952c46 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 26 Feb 2018 18:19:14 +0000 Subject: 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 Reviewed-by: Ryan Harrison --- testing/resources/calculate.in | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 testing/resources/calculate.in (limited to 'testing/resources/calculate.in') diff --git a/testing/resources/calculate.in b/testing/resources/calculate.in new file mode 100644 index 0000000000..3e40bf8ff5 --- /dev/null +++ b/testing/resources/calculate.in @@ -0,0 +1,62 @@ +{{header}} +{{object 1 0}} << + /AcroForm 11 0 R + /Pages 5 0 R + /Type /Catalog +>> +endobj + +{{object 11 0}} << + /Fields [57 0 R 61 0 R] +>> +endobj + +{{object 5 0}} << + /Count 1 + /Type /Pages + /Kids [12 0 R] +>> +endobj + +{{object 12 0}} << + /CropBox [0.0 0.0 720.0 540.0] + /Annots [57 0 R 61 0 R] + /Parent 5 0 R + /MediaBox[0.0 0.0 720.0 540.0] + /TrimBox[0.0 0.0 720.0 540.0] + /Type /Page +>> +endobj + +{{object 57 0}} << + /Rect [142.13 307.409 208.842 331.442] + /Subtype /Widget + /F 4 + /P 12 0 R + /Q 2 + /T (Calc1_A) + /V (5) + /DV (5) + /FT /Tx + /Type /Annot +>> +endobj + +{{object 61 0}} << + /Rect [290.306 307.409 357.793 331.442] + /Subtype /Widget + /F 4 + /P 12 0 R + /Q 2 + /T (Calc1_B) + /V (2) + /DV (2) + /FT /Tx + /Type /Annot +>> +endobj + +{{xref}} +{{trailer}} +{{startxref}} +%%EOF -- cgit v1.2.3