summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-16 16:06:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-16 16:06:45 +0000
commit2056fac754e679baea695390854fe7b0ce7acb28 (patch)
treeb0f2b982ac2ea9d4206ecd9703eb439ad524cb32 /core/fpdfdoc/cpdf_formfield.h
parentd3427164e7869ee9c22fcb843ab619b247cbed72 (diff)
downloadpdfium-2056fac754e679baea695390854fe7b0ce7acb28.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r--core/fpdfdoc/cpdf_formfield.h32
1 files changed, 25 insertions, 7 deletions
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<FormFieldType> 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
};