From c8ff50435b01b765e575c93038aee08eafc7d82c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 13 Oct 2015 15:17:46 -0700 Subject: Changes to master to more closely match XFA. These files should change in master in order to reduce the number of "noise diffs" between master and XFA as seen in https://codereview.chromium.org/1399273003/ This includes: whitespace, matching header ordering, and implementing a GetPageFromFPDFPage() from XFA. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1407583004 . --- fpdfsdk/src/formfiller/FFL_IFormFiller.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'fpdfsdk/src/formfiller') diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 69ff93280e..ce0a67f4fe 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -509,23 +509,15 @@ FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) { } FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { - ASSERT(pWidget != NULL); - if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) return TRUE; - else { - CPDF_Page* pPage = pWidget->GetPDFPage(); - ASSERT(pPage != NULL); - - CPDF_Document* pDocument = pPage->m_pDocument; - ASSERT(pDocument != NULL); - FX_DWORD dwPermissions = pDocument->GetUserPermissions(); - return (dwPermissions & FPDFPERM_FILL_FORM) || - (dwPermissions & FPDFPERM_ANNOT_FORM) || - (dwPermissions & FPDFPERM_MODIFY); - } - return TRUE; + CPDF_Page* pPage = pWidget->GetPDFPage(); + CPDF_Document* pDocument = pPage->m_pDocument; + FX_DWORD dwPermissions = pDocument->GetUserPermissions(); + return (dwPermissions & FPDFPERM_FILL_FORM) || + (dwPermissions & FPDFPERM_ANNOT_FORM) || + (dwPermissions & FPDFPERM_MODIFY); } CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, @@ -802,13 +794,10 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { - ASSERT(pPageView != NULL); - ASSERT(pAnnot != NULL); - if (pPageView) return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot()); - else - return FALSE; + + return FALSE; } void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, -- cgit v1.2.3