Skip to content

Commit

Permalink
Fix Fields coercement
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Sep 6, 2024
1 parent a29f672 commit ef0ed2e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion lib/PDF/Action/SubmitForm.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ my subset FieldRef where PDF::Field|PDF::COS::TextString;
multi sub coerce-field-ref(Hash $fld, FieldRef) { coerce-field($fld, PDF::Field) }
multi sub coerce-field-ref(Str $value is rw, FieldRef) { $value = PDF::COS::TextString.COERCE($value) }
multi sub coerce-field-ref($_, $) { warn "unable to coerce to field reference: {.raku}"; }
has FieldRef @.Fields is entry(:coerce(&coerce-field)); #= (Optional) An array identifying which fields to include in the submission or which to exclude, depending on the setting of the Include/Exclude flag in the Flags entry. Each element of the array is either an indirect reference to a field dictionary or (PDF 1.3) a text string representing the fully qualified name of a field. Elements of both kinds may be mixed in the same array.
has FieldRef @.Fields is entry(:coerce(&coerce-field-ref)); #= (Optional) An array identifying which fields to include in the submission or which to exclude, depending on the setting of the Include/Exclude flag in the Flags entry. Each element of the array is either an indirect reference to a field dictionary or (PDF 1.3) a text string representing the fully qualified name of a field. Elements of both kinds may be mixed in the same array.

=para If this entry is omitted, the Include/Exclude flag is ignored, and all fields in the document’s interactive form is submitted except those whose NoExport flag is set. Fields with no values may also be excluded, as dictated by the value of the IncludeNoValueFields flag.
Expand Down
3 changes: 0 additions & 3 deletions lib/PDF/Field.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ multi sub coerce-field(PDF::COS::Dict() $dict, PDF::Field $field) is export(:coe
my PDF::Field:U $class = $field.field-delegate( $dict );
$class.COERCE: $dict;
}
method coerce-field(Hash $dict) {
coerce-field($dict, PDF::Field);
}

method type { 'Field' }
has FieldSubtypeName $.FT is entry(:inherit, :alias<subtype>); # Required for terminal fields; inheritable) The type of field that this dictionary describes
Expand Down

0 comments on commit ef0ed2e

Please sign in to comment.