Commit 3dab30025703c43ec449efe8c1906d3a76d3250f

Authored by James R. Barlow
1 parent ac94437a

Implement QPDFFormFieldObjectHelper::isChecked

API was defined, but .cc had no implementation. PDF 2.0 manual is surprisingly unclear as to on/off values, giving /Yes in an example and /Off in descriptive text as "not on".
libqpdf/QPDFFormFieldObjectHelper.cc
... ... @@ -248,6 +248,12 @@ QPDFFormFieldObjectHelper::isCheckbox()
248 248 }
249 249  
250 250 bool
  251 +QPDFFormFieldObjectHelper::isChecked()
  252 +{
  253 + return isCheckbox() && getValue().isName() && (getValue().getName() != "/Off");
  254 +}
  255 +
  256 +bool
251 257 QPDFFormFieldObjectHelper::isRadioButton()
252 258 {
253 259 return ((getFieldType() == "/Btn") && ((getFlags() & ff_btn_radio) == ff_btn_radio));
... ...