summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-13 15:17:46 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-13 15:17:46 -0700
commitc8ff50435b01b765e575c93038aee08eafc7d82c (patch)
treee31c372667e4c4f1906b46ad5a281e7a6875a624 /fpdfsdk/src/formfiller
parent6eeffab789800e2afa1b9d10de70c9116db32355 (diff)
downloadpdfium-c8ff50435b01b765e575c93038aee08eafc7d82c.tar.xz
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 .
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp27
1 files changed, 8 insertions, 19 deletions
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,