diff options
author | Jay Berkenbilt <ejb@ql.org> | 2024-02-11 21:32:02 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2024-02-11 21:49:44 +0100 |
commit | b1dad0de2a12a0feb0608d1f68f3f1e8144592e6 (patch) | |
tree | 3a8be3e2c47b3a2ffd9b68d9facec3d2484f4228 /qpdf | |
parent | b1b789df4203296a848fec6a3513f30efceb1a45 (diff) | |
download | qpdf-b1dad0de2a12a0feb0608d1f68f3f1e8144592e6.tar.zst |
Fix previous fix to setting checkbox value (fixes #1056)
The code accepted values other than /Yes but still used /Yes as the
checked value instead of obeying the normal appearance dictionary.
Diffstat (limited to 'qpdf')
-rw-r--r-- | qpdf/qtest/qpdf/button-set-out.pdf | 6 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/button-set.pdf | 2 | ||||
-rw-r--r-- | qpdf/test_driver.cc | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/qpdf/qtest/qpdf/button-set-out.pdf b/qpdf/qtest/qpdf/button-set-out.pdf index b7ceae01..d08f4586 100644 --- a/qpdf/qtest/qpdf/button-set-out.pdf +++ b/qpdf/qtest/qpdf/button-set-out.pdf @@ -122,7 +122,7 @@ endobj >> /P 15 0 R /T (checkbox1) - /V /Yes + /V /Yup >> endobj @@ -589,10 +589,10 @@ endobj /AP << /N << /Off 64 0 R - /Yes 66 0 R + /Yup 66 0 R >> >> - /AS /Yes + /AS /Yup /F 4 /Rect [ 118.649 diff --git a/qpdf/qtest/qpdf/button-set.pdf b/qpdf/qtest/qpdf/button-set.pdf index fe96f336..ca65395f 100644 --- a/qpdf/qtest/qpdf/button-set.pdf +++ b/qpdf/qtest/qpdf/button-set.pdf @@ -3481,7 +3481,7 @@ endobj /AP << /N << /Off 24 0 R - /Yes 26 0 R + /Yup 26 0 R >> >> /AS /Off diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc index 28d8062c..e7451576 100644 --- a/qpdf/test_driver.cc +++ b/qpdf/test_driver.cc @@ -1942,7 +1942,9 @@ test_51(QPDF& pdf, char const* arg2) } else if (Tval == "checkbox1") { std::cout << "turning checkbox1 on\n"; QPDFFormFieldObjectHelper foh(field); - foh.setV(QPDFObjectHandle::newName("/Yes")); + // The value that eventually gets set is based on what's allowed in /N and may not match + // this value. + foh.setV(QPDFObjectHandle::newName("/Sure")); } else if (Tval == "checkbox2") { std::cout << "turning checkbox2 off\n"; QPDFFormFieldObjectHelper foh(field); |