summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fxjs/cjs_field.cpp23
-rw-r--r--fxjs/cjs_field.h5
2 files changed, 13 insertions, 15 deletions
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 0682b9a132..5364a68d23 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -262,13 +262,12 @@ std::vector<CPDF_FormField*> CJS_Field::GetFormFields(
return fields;
}
-std::vector<CPDF_FormField*> CJS_Field::GetFormFields(
- const WideString& csFieldName) const {
- return CJS_Field::GetFormFields(m_pFormFillEnv.Get(), csFieldName);
+std::vector<CPDF_FormField*> CJS_Field::GetFormFields() const {
+ return CJS_Field::GetFormFields(m_pFormFillEnv.Get(), m_FieldName);
}
CPDF_FormField* CJS_Field::GetFirstFormField() const {
- std::vector<CPDF_FormField*> fields = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> fields = GetFormFields();
return fields.empty() ? nullptr : fields[0];
}
@@ -374,7 +373,7 @@ CPDFSDK_Widget* CJS_Field::GetWidget(CPDFSDK_FormFillEnvironment* pFormFillEnv,
}
bool CJS_Field::ValueIsOccur(CPDF_FormField* pFormField,
- WideString csOptLabel) {
+ WideString csOptLabel) const {
for (int i = 0, sz = pFormField->CountOptions(); i < sz; i++) {
if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
return true;
@@ -1183,7 +1182,7 @@ CJS_Return CJS_Field::get_fill_color(CJS_Runtime* pRuntime) {
CJS_Return CJS_Field::set_fill_color(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
if (!m_bCanSet)
@@ -1386,7 +1385,7 @@ CJS_Return CJS_Field::set_multiple_selection(CJS_Runtime* pRuntime,
}
CJS_Return CJS_Field::get_name(CJS_Runtime* pRuntime) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
@@ -1486,7 +1485,7 @@ CJS_Return CJS_Field::get_print(CJS_Runtime* pRuntime) {
CJS_Return CJS_Field::set_print(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
@@ -1556,7 +1555,7 @@ CJS_Return CJS_Field::get_radios_in_unison(CJS_Runtime* pRuntime) {
CJS_Return CJS_Field::set_radios_in_unison(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
if (!m_bCanSet)
@@ -1575,7 +1574,7 @@ CJS_Return CJS_Field::get_readonly(CJS_Runtime* pRuntime) {
CJS_Return CJS_Field::set_readonly(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
if (!m_bCanSet)
@@ -1710,7 +1709,7 @@ CJS_Return CJS_Field::get_required(CJS_Runtime* pRuntime) {
CJS_Return CJS_Field::set_required(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
if (!m_bCanSet)
@@ -2376,7 +2375,7 @@ CJS_Return CJS_Field::deleteItemAt(
CJS_Return CJS_Field::getArray(
CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params) {
- std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
+ std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Return(JSMessage::kBadObjectError);
diff --git a/fxjs/cjs_field.h b/fxjs/cjs_field.h
index 1263f0b775..12fcd2a7fe 100644
--- a/fxjs/cjs_field.h
+++ b/fxjs/cjs_field.h
@@ -403,11 +403,10 @@ class CJS_Field : public CJS_Object {
void ParseFieldName(const std::wstring& strFieldNameParsed,
std::wstring& strFieldName,
int& iControlNo);
- std::vector<CPDF_FormField*> GetFormFields(
- const WideString& csFieldName) const;
+ std::vector<CPDF_FormField*> GetFormFields() const;
CPDF_FormField* GetFirstFormField() const;
CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField);
- bool ValueIsOccur(CPDF_FormField* pFormField, WideString csOptLabel);
+ bool ValueIsOccur(CPDF_FormField* pFormField, WideString csOptLabel) const;
void AddDelay_Int(FIELD_PROP prop, int32_t n);
void AddDelay_Bool(FIELD_PROP prop, bool b);