diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-05 20:02:16 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-05 20:02:16 +0000 |
commit | 66095ebfb9fe0b522e56753b7d1b997e65b8b219 (patch) | |
tree | a8dc5591056f9f9befd603944c88910644fb82ea /core/fpdfdoc/cpdf_formfield.h | |
parent | be4e055bce62c9af26461f435704b9aa086f6fc4 (diff) | |
download | pdfium-66095ebfb9fe0b522e56753b7d1b997e65b8b219.tar.xz |
Add methods to read specific field flags in CPDF_FormField.
Instead of reading the entire field flags value and applying bitmasks.
Also read an unused setter and make a member const.
Change-Id: I4ad645765ac58864b9c155ee9fe740aca4396d52
Reviewed-on: https://pdfium-review.googlesource.com/c/43532
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 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index 0a02596cf6..a3af10bdee 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -110,7 +110,6 @@ class CPDF_FormField { uint32_t GetFlags() const { return m_Flags; } CPDF_Dictionary* GetFieldDict() const { return m_pDict.Get(); } - void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } bool ResetField(NotificationOption notify); @@ -132,6 +131,11 @@ class CPDF_FormField { uint32_t GetFieldFlags() const; 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); } + WideString GetValue() const; WideString GetDefaultValue() const; bool SetValue(const WideString& value, NotificationOption notify); @@ -201,13 +205,13 @@ class CPDF_FormField { bool NotifyListOrComboBoxBeforeChange(const WideString& value); void NotifyListOrComboBoxAfterChange(); - CPDF_FormField::Type m_Type; + CPDF_FormField::Type m_Type = Unknown; uint32_t m_Flags; UnownedPtr<CPDF_InterForm> const m_pForm; - UnownedPtr<CPDF_Dictionary> m_pDict; + UnownedPtr<CPDF_Dictionary> const m_pDict; // Owned by InterForm parent. std::vector<UnownedPtr<CPDF_FormControl>> m_ControlList; - float m_FontSize; + float m_FontSize = 0; UnownedPtr<CPDF_Font> m_pFont; }; |