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 --- public/fpdf_formfill.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'public') diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h index e4cdaee0f6..c2e2bd515a 100644 --- a/public/fpdf_formfill.h +++ b/public/fpdf_formfill.h @@ -1453,13 +1453,31 @@ FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle); #define FPDF_FORMFIELD_TEXTFIELD 6 // text field type. #define FPDF_FORMFIELD_SIGNATURE 7 // text field type. #ifdef PDF_ENABLE_XFA -#define FPDF_FORMFIELD_XFA 8 // Generic XFA type. -#endif // PDF_ENABLE_XFA +#define FPDF_FORMFIELD_XFA 8 // Generic XFA type. +#define FPDF_FORMFIELD_XFA_CHECKBOX 9 // XFA check box type. +#define FPDF_FORMFIELD_XFA_COMBOBOX 10 // XFA combo box type. +#define FPDF_FORMFIELD_XFA_IMAGEFIELD 11 // XFA image field type. +#define FPDF_FORMFIELD_XFA_LISTBOX 12 // XFA list box type. +#define FPDF_FORMFIELD_XFA_PUSHBUTTON 13 // XFA push button type. +#define FPDF_FORMFIELD_XFA_SIGNATURE 14 // XFA signture field type. +#define FPDF_FORMFIELD_XFA_TEXTFIELD 15 // XFA text field type. +#endif // PDF_ENABLE_XFA #ifndef PDF_ENABLE_XFA #define FPDF_FORMFIELD_COUNT 8 #else -#define FPDF_FORMFIELD_COUNT 9 +#define FPDF_FORMFIELD_COUNT 16 +#endif // PDF_ENABLE_XFA + +#ifdef PDF_ENABLE_XFA +#define IS_XFA_FORMFIELD(type) \ + ((type == FPDF_FORMFIELD_XFA) || (type == FPDF_FORMFIELD_XFA_CHECKBOX) || \ + (type == FPDF_FORMFIELD_XFA_COMBOBOX) || \ + (type == FPDF_FORMFIELD_XFA_IMAGEFIELD) || \ + (type == FPDF_FORMFIELD_XFA_LISTBOX) || \ + (type == FPDF_FORMFIELD_XFA_PUSHBUTTON) || \ + (type == FPDF_FORMFIELD_XFA_SIGNATURE) || \ + (type == FPDF_FORMFIELD_XFA_TEXTFIELD)) #endif // PDF_ENABLE_XFA /** -- cgit v1.2.3