CPDF_InterForm::ResetForm always returns true
This method always returns true, so remove the return value.
Change-Id: I3da93fc5face39a53b589787873839c06c9fcfab
Reviewed-on: https://pdfium-review.googlesource.com/28210
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 2fbc3aa..ac15aa6 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -898,7 +898,7 @@
return m_pFormDict ? m_pFormDict->GetIntegerFor("Q", 0) : 0;
}
-bool CPDF_InterForm::ResetForm(const std::vector<CPDF_FormField*>& fields,
+void CPDF_InterForm::ResetForm(const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
bool bNotify) {
size_t nCount = m_pFieldTree->m_Root.CountFields();
@@ -912,10 +912,9 @@
}
if (bNotify && m_pFormNotify)
m_pFormNotify->AfterFormReset(this);
- return true;
}
-bool CPDF_InterForm::ResetForm(bool bNotify) {
+void CPDF_InterForm::ResetForm(bool bNotify) {
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);
@@ -926,7 +925,6 @@
}
if (bNotify && m_pFormNotify)
m_pFormNotify->AfterFormReset(this);
- return true;
}
void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel) {
diff --git a/core/fpdfdoc/cpdf_interform.h b/core/fpdfdoc/cpdf_interform.h
index e267384..2f60bf7 100644
--- a/core/fpdfdoc/cpdf_interform.h
+++ b/core/fpdfdoc/cpdf_interform.h
@@ -80,10 +80,10 @@
bool bIncludeOrExclude,
bool bSimpleFileSpec) const;
- bool ResetForm(const std::vector<CPDF_FormField*>& fields,
+ void ResetForm(const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
bool bNotify);
- bool ResetForm(bool bNotify);
+ void ResetForm(bool bNotify);
void SetFormNotify(IPDF_FormNotify* pNotify);
bool HasXFAForm() const;
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 57f3a6e..f4e22d7 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -592,19 +592,21 @@
return pFDF ? pFDF->WriteToString() : ByteString();
}
-bool CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action) {
+void CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action) {
ASSERT(action.GetDict());
CPDF_Dictionary* pActionDict = action.GetDict();
- if (!pActionDict->KeyExist("Fields"))
- return m_pInterForm->ResetForm(true);
+ if (!pActionDict->KeyExist("Fields")) {
+ m_pInterForm->ResetForm(true);
+ return;
+ }
CPDF_ActionFields af(&action);
uint32_t dwFlags = action.GetFlags();
std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
- return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), true);
+ m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), true);
}
std::vector<CPDF_FormField*> CPDFSDK_InterForm::GetFieldFromObjects(
diff --git a/fpdfsdk/cpdfsdk_interform.h b/fpdfsdk/cpdfsdk_interform.h
index 58dc2d0..6195ee9 100644
--- a/fpdfsdk/cpdfsdk_interform.h
+++ b/fpdfsdk/cpdfsdk_interform.h
@@ -77,7 +77,7 @@
bool DoAction_Hide(const CPDF_Action& action);
bool DoAction_SubmitForm(const CPDF_Action& action);
- bool DoAction_ResetForm(const CPDF_Action& action);
+ void DoAction_ResetForm(const CPDF_Action& action);
std::vector<CPDF_FormField*> GetFieldFromObjects(
const std::vector<CPDF_Object*>& objects) const;
diff --git a/fpdfsdk/fsdk_actionhandler.cpp b/fpdfsdk/fsdk_actionhandler.cpp
index 5999763..c0e413f 100644
--- a/fpdfsdk/fsdk_actionhandler.cpp
+++ b/fpdfsdk/fsdk_actionhandler.cpp
@@ -515,11 +515,11 @@
return pInterForm->DoAction_SubmitForm(action);
}
-bool CPDFSDK_ActionHandler::DoAction_ResetForm(
+void CPDFSDK_ActionHandler::DoAction_ResetForm(
const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv) {
CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
- return pInterForm->DoAction_ResetForm(action);
+ pInterForm->DoAction_ResetForm(action);
}
void CPDFSDK_ActionHandler::RunScriptForAction(
diff --git a/fpdfsdk/fsdk_actionhandler.h b/fpdfsdk/fsdk_actionhandler.h
index a77ee77..1aaf2f9 100644
--- a/fpdfsdk/fsdk_actionhandler.h
+++ b/fpdfsdk/fsdk_actionhandler.h
@@ -120,7 +120,7 @@
CPDFSDK_FormFillEnvironment* pFormFillEnv);
bool DoAction_SubmitForm(const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv);
- bool DoAction_ResetForm(const CPDF_Action& action,
+ void DoAction_ResetForm(const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv);
};