Remove BeforeFormImportData and BeforeFormReset
Both of these IPDF_FormNotify callbacks have empty implementations which
just return 0. Removed.
Change-Id: I3324113222f19d2f7a2323ab5086e446d2064451
Reviewed-on: https://pdfium-review.googlesource.com/28191
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 1596b17..c8440ea 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -901,9 +901,6 @@
bool CPDF_InterForm::ResetForm(const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
bool bNotify) {
- if (bNotify && m_pFormNotify && m_pFormNotify->BeforeFormReset(this) < 0)
- return false;
-
size_t nCount = m_pFieldTree->m_Root.CountFields();
for (size_t i = 0; i < nCount; ++i) {
CPDF_FormField* pField = m_pFieldTree->m_Root.GetFieldAtIndex(i);
@@ -919,9 +916,6 @@
}
bool CPDF_InterForm::ResetForm(bool bNotify) {
- if (bNotify && m_pFormNotify && m_pFormNotify->BeforeFormReset(this) < 0)
- return false;
-
size_t nCount = m_pFieldTree->m_Root.CountFields();
for (size_t i = 0; i < nCount; ++i) {
CPDF_FormField* pField = m_pFieldTree->m_Root.GetFieldAtIndex(i);
diff --git a/core/fpdfdoc/ipdf_formnotify.h b/core/fpdfdoc/ipdf_formnotify.h
index 301139b..10a97a0 100644
--- a/core/fpdfdoc/ipdf_formnotify.h
+++ b/core/fpdfdoc/ipdf_formnotify.h
@@ -19,13 +19,13 @@
virtual int BeforeValueChange(CPDF_FormField* pField,
const WideString& csValue) = 0;
virtual void AfterValueChange(CPDF_FormField* pField) = 0;
+
virtual int BeforeSelectionChange(CPDF_FormField* pField,
const WideString& csValue) = 0;
virtual void AfterSelectionChange(CPDF_FormField* pField) = 0;
+
virtual void AfterCheckedStatusChange(CPDF_FormField* pField) = 0;
- virtual int BeforeFormReset(CPDF_InterForm* pForm) = 0;
virtual void AfterFormReset(CPDF_InterForm* pForm) = 0;
- virtual int BeforeFormImportData(CPDF_InterForm* pForm) = 0;
};
#endif // CORE_FPDFDOC_IPDF_FORMNOTIFY_H_
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 9e4c5f4..94c9b23 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -680,18 +680,10 @@
UpdateField(pField);
}
-int CPDFSDK_InterForm::BeforeFormReset(CPDF_InterForm* pForm) {
- return 0;
-}
-
void CPDFSDK_InterForm::AfterFormReset(CPDF_InterForm* pForm) {
OnCalculate(nullptr);
}
-int CPDFSDK_InterForm::BeforeFormImportData(CPDF_InterForm* pForm) {
- return 0;
-}
-
bool CPDFSDK_InterForm::IsNeedHighLight(FormFieldType fieldType) {
if (fieldType == FormFieldType::kUnknown)
return false;
diff --git a/fpdfsdk/cpdfsdk_interform.h b/fpdfsdk/cpdfsdk_interform.h
index 7e2ae04..893b601 100644
--- a/fpdfsdk/cpdfsdk_interform.h
+++ b/fpdfsdk/cpdfsdk_interform.h
@@ -109,9 +109,7 @@
const WideString& csValue) override;
void AfterSelectionChange(CPDF_FormField* pField) override;
void AfterCheckedStatusChange(CPDF_FormField* pField) override;
- int BeforeFormReset(CPDF_InterForm* pForm) override;
void AfterFormReset(CPDF_InterForm* pForm) override;
- int BeforeFormImportData(CPDF_InterForm* pForm) override;
bool FDFToURLEncodedData(uint8_t*& pBuf, size_t& nBufSize);
int GetPageIndexByAnnotDict(CPDF_Document* pDocument,