From 2056fac754e679baea695390854fe7b0ce7acb28 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 16 Jan 2018 16:06:45 +0000 Subject: Add support for XFA specific FormField types This adds to form field types specific types for XFA form fields to be used instead of the generic XFA value when possible. BUG=pdfium:952,chromium:763129,chromium:592758 Change-Id: I8d1cff6a280d71db348b7c31a251cbe2e398ec79 Reviewed-on: https://pdfium-review.googlesource.com/22677 Reviewed-by: dsinclair Commit-Queue: Ryan Harrison --- core/fpdfdoc/cpdf_formfield.h | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index 1f1205dabe..4f25465b43 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -28,26 +28,44 @@ enum class FormFieldType : uint8_t { kTextField = 6, kSignature = 7, #ifdef PDF_ENABLE_XFA - kXFA = 8, // Generic XFA field. -#endif // PDF_ENABLE_XFA + kXFA = 8, // Generic XFA field, should use value below if possible. + kXFA_CheckBox = 9, + kXFA_ComboBox = 10, + kXFA_ImageField = 11, + kXFA_ListBox = 12, + kXFA_PushButton = 13, + kXFA_Signature = 14, + kXFA_TextField = 15 +#endif // PDF_ENABLE_XFA }; Optional IntToFormFieldType(int value); // If values are added to FormFieldType, these will need to be updated. #ifdef PDF_ENABLE_XFA -constexpr size_t kFormFieldTypeCount = 9; +constexpr size_t kFormFieldTypeCount = 16; #else constexpr size_t kFormFieldTypeCount = 8; #endif // PDF_ENABLE_XFA constexpr FormFieldType kFormFieldTypes[kFormFieldTypeCount] = { - FormFieldType::kUnknown, FormFieldType::kPushButton, - FormFieldType::kCheckBox, FormFieldType::kRadioButton, - FormFieldType::kComboBox, FormFieldType::kListBox, - FormFieldType::kTextField, FormFieldType::kSignature, + FormFieldType::kUnknown, + FormFieldType::kPushButton, + FormFieldType::kCheckBox, + FormFieldType::kRadioButton, + FormFieldType::kComboBox, + FormFieldType::kListBox, + FormFieldType::kTextField, + FormFieldType::kSignature, #ifdef PDF_ENABLE_XFA FormFieldType::kXFA, + FormFieldType::kXFA_CheckBox, + FormFieldType::kXFA_ComboBox, + FormFieldType::kXFA_ImageField, + FormFieldType::kXFA_ListBox, + FormFieldType::kXFA_PushButton, + FormFieldType::kXFA_Signature, + FormFieldType::kXFA_TextField #endif // PDF_ENABLE_XFA }; -- cgit v1.2.3