diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-05 21:18:16 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-05 21:18:16 +0000 |
commit | 28df406817f501b4c133d56ef09cb0d6d90181ca (patch) | |
tree | c1340d53bdcc5750d71f9664d2fe8a69b9773094 /core/fpdfdoc/cpdf_formfield.h | |
parent | b20364c990152495dc259a4a8fc36cdd7dbd7ca4 (diff) | |
download | pdfium-28df406817f501b4c133d56ef09cb0d6d90181ca.tar.xz |
Add booleans for form flags in CPDF_FormField.
Add constants/form_flags.h as well.
Change-Id: If15deff6bafdf394ed975b767128d65b5d2eb0e9
Reviewed-on: https://pdfium-review.googlesource.com/c/43533
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index a3af10bdee..1f070848c7 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -70,10 +70,6 @@ constexpr FormFieldType kFormFieldTypes[kFormFieldTypeCount] = { #endif // PDF_ENABLE_XFA }; -#define FORMFLAG_READONLY 0x01 -#define FORMFLAG_REQUIRED 0x02 -#define FORMFLAG_NOEXPORT 0x04 - class CPDF_Dictionary; class CPDF_Font; class CPDF_FormControl; @@ -132,9 +128,9 @@ class CPDF_FormField { ByteString GetDefaultStyle() const; // TODO(thestig): Figure out what to do with unused methods here. - bool IsReadOnly() const { return !!(m_Flags & FORMFLAG_READONLY); } - bool IsRequired() const { return !!(m_Flags & FORMFLAG_REQUIRED); } - bool IsNoExport() const { return !!(m_Flags & FORMFLAG_NOEXPORT); } + bool IsReadOnly() const { return m_bReadOnly; } + bool IsRequired() const { return m_bRequired; } + bool IsNoExport() const { return m_bNoExport; } WideString GetValue() const; WideString GetDefaultValue() const; @@ -191,7 +187,7 @@ class CPDF_FormField { bool SetValue(const WideString& value, bool bDefault, NotificationOption notify); - void SyncFieldFlags(); + void InitFieldFlags(); int FindListSel(CPDF_String* str); WideString GetOptionText(int index, int sub_index) const; void LoadDA(); @@ -206,7 +202,11 @@ class CPDF_FormField { void NotifyListOrComboBoxAfterChange(); CPDF_FormField::Type m_Type = Unknown; - uint32_t m_Flags; + uint32_t m_Flags = 0; + bool m_bReadOnly = false; + bool m_bRequired = false; + bool m_bNoExport = false; + UnownedPtr<CPDF_InterForm> const m_pForm; UnownedPtr<CPDF_Dictionary> const m_pDict; // Owned by InterForm parent. |