From 66095ebfb9fe0b522e56753b7d1b997e65b8b219 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 5 Oct 2018 20:02:16 +0000 Subject: 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 Reviewed-by: Tom Sepez --- core/fpdfdoc/cpdf_interform.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'core/fpdfdoc/cpdf_interform.cpp') 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; -- cgit v1.2.3