diff options
| author | Emulator000 | 2020-09-24 00:35:10 +0200 |
|---|---|---|
| committer | Emulator000 | 2020-09-24 00:35:10 +0200 |
| commit | 895a753cd531fc2ad43365299775910c2ce04efa (patch) | |
| tree | 43451a06ab96e04df984bc655a89af3d108c62dc | |
| parent | bc98ee497b9082aeec64415fc2e94eee442819d9 (diff) | |
| download | pdf_form-895a753cd531fc2ad43365299775910c2ce04efa.tar.bz2 | |
Handling of unknown fields
| -rw-r--r-- | src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -36,6 +36,7 @@ pub enum FieldType { ListBox, ComboBox, Text, + Unknown, } #[derive(Debug, Error)] @@ -102,6 +103,8 @@ pub enum FieldState { readonly: bool, required: bool, }, + /// Unknown fields have no state + Unknown, } trait PdfObjectDeref { @@ -206,8 +209,10 @@ impl Form { } else { FieldType::ListBox } - } else { + } else if type_str == "Tx" { FieldType::Text + } else { + FieldType::Unknown } } @@ -398,6 +403,7 @@ impl Form { readonly: is_read_only(field), required: is_required(field), }, + FieldType::Unknown => FieldState::Unknown, } } |
