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_interform.cpp | |
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_interform.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index bacf6fd426..8a88791ee9 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -969,9 +969,7 @@ bool CPDF_InterForm::CheckRequiredFields( iType == CPDF_FormField::CheckBox || iType == CPDF_FormField::ListBox) { continue; } - uint32_t dwFlags = pField->GetFieldFlags(); - // TODO(thestig): Look up these magic numbers and add constants for them. - if (dwFlags & FORMFLAG_NOEXPORT) + if (pField->IsNoExport()) continue; bool bFind = true; @@ -979,10 +977,8 @@ bool CPDF_InterForm::CheckRequiredFields( bFind = pdfium::ContainsValue(*fields, pField); if (bIncludeOrExclude == bFind) { const CPDF_Dictionary* pFieldDict = pField->GetDict(); - if ((dwFlags & FORMFLAG_REQUIRED) != 0 && - pFieldDict->GetStringFor("V").IsEmpty()) { + if (pField->IsRequired() && pFieldDict->GetStringFor("V").IsEmpty()) return false; - } } } return true; |