From a478dc5ca23b6f2f609b119cdc6b0336d1471d8c Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Mon, 23 Jan 2017 15:48:51 -0500 Subject: Fix CPDF_InterForm::CheckRequiredFields and its callers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method is used twice in fpdfsdk/cpdfsdk_interform.cpp and twice in fpdfsdk/javascript/Document.cpp, but not in a compatible way. Changed the method so that it now returns true when checks pass, which is the more natural thing to do, considering the name of the method. BUG=pdfium:659 Change-Id: Iacf3049f328df1d4db3fbfc995acf184230ebf48 Reviewed-on: https://pdfium-review.googlesource.com/2297 Commit-Queue: Nicolás Peña Reviewed-by: Tom Sepez --- core/fpdfdoc/cpdf_formfield.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'core/fpdfdoc/cpdf_formfield.cpp') diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index b344327adc..b4aa90e2be 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -31,10 +31,6 @@ const int kFormListMultiSelect = 0x100; const int kFormComboEdit = 0x100; -const int kFormFieldReadOnly = 0x01; -const int kFormFieldRequired = 0x02; -const int kFormFieldNoExport = 0x04; - const int kFormRadioNoToggleOff = 0x100; const int kFormRadioUnison = 0x200; @@ -108,12 +104,12 @@ void CPDF_FormField::SyncFieldFlags() { ? FPDF_GetFieldAttr(m_pDict, "Ff")->GetInteger() : 0; m_Flags = 0; - if (flags & 1) - m_Flags |= kFormFieldReadOnly; - if (flags & 2) - m_Flags |= kFormFieldRequired; - if (flags & 4) - m_Flags |= kFormFieldNoExport; + if (flags & FORMFLAG_READONLY) + m_Flags |= FORMFLAG_READONLY; + if (flags & FORMFLAG_REQUIRED) + m_Flags |= FORMFLAG_REQUIRED; + if (flags & FORMFLAG_NOEXPORT) + m_Flags |= FORMFLAG_NOEXPORT; if (type_name == "Btn") { if (flags & 0x8000) { -- cgit v1.2.3