Remove always-true parameter from CXFA_Node::SetItemState()
Change-Id: I7c2bd5c03b48e9060a57d50b0d4d08d071b59a6c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/92196
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 6229ec1..299af05 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -281,7 +281,7 @@
int nIndex = pFormField->GetSelectedIndex(i);
if (nIndex > -1 &&
static_cast<size_t>(nIndex) < node->CountChoiceListItems(false)) {
- node->SetItemState(nIndex, true, false, false, true);
+ node->SetItemState(nIndex, true, false, false);
}
}
if (GetFieldType() == FormFieldType::kComboBox)
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp
index 854471e..44b6011 100644
--- a/fxjs/xfa/cjx_field.cpp
+++ b/fxjs/xfa/cjx_field.cpp
@@ -198,11 +198,11 @@
int32_t iIndex = runtime->ToInt32(params[0]);
if (runtime->ToInt32(params[1]) != 0) {
- node->SetItemState(iIndex, true, true, true, true);
+ node->SetItemState(iIndex, true, true, true);
return CJS_Result::Success();
}
if (node->GetItemState(iIndex))
- node->SetItemState(iIndex, false, true, true, true);
+ node->SetItemState(iIndex, false, true, true);
return CJS_Result::Success();
}
@@ -393,7 +393,7 @@
return;
}
- node->SetItemState(iIndex, true, true, true, true);
+ node->SetItemState(iIndex, true, true, true);
}
void CJX_Field::rawValue(v8::Isolate* pIsolate,
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index de9f3bc..f8ce091 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -4342,8 +4342,7 @@
void CXFA_Node::SetItemState(int32_t nIndex,
bool bSelected,
bool bNotify,
- bool bScriptModify,
- bool bSyncData) {
+ bool bScriptModify) {
std::vector<WideString> wsSaveTextArray = GetChoiceListItems(true);
if (!fxcrt::IndexInBounds(wsSaveTextArray, nIndex))
return;
@@ -4364,8 +4363,7 @@
wsValue += L"\n";
}
wsValue += wsSaveTextArray[nIndex];
- JSObject()->SetContent(wsValue, wsValue, bNotify, bScriptModify,
- bSyncData);
+ JSObject()->SetContent(wsValue, wsValue, bNotify, bScriptModify, true);
}
} else if (iSel >= 0) {
std::vector<int32_t> iSelArray = GetSelectedItems();
@@ -4373,18 +4371,18 @@
std::find(iSelArray.begin(), iSelArray.end(), nIndex);
if (selected_iter != iSelArray.end())
iSelArray.erase(selected_iter);
- SetSelectedItems(iSelArray, bNotify, bScriptModify, bSyncData);
+ SetSelectedItems(iSelArray, bNotify, bScriptModify, true);
}
} else {
if (bSelected) {
if (iSel < 0) {
WideString wsSaveText = wsSaveTextArray[nIndex];
JSObject()->SetContent(wsSaveText, GetFormatDataValue(wsSaveText),
- bNotify, bScriptModify, bSyncData);
+ bNotify, bScriptModify, true);
}
} else if (iSel >= 0) {
JSObject()->SetContent(WideString(), WideString(), bNotify, bScriptModify,
- bSyncData);
+ true);
}
}
}
@@ -4574,7 +4572,7 @@
}
} else {
if (!bSetValue && pItems->JSObject()->GetBoolean(XFA_Attribute::Save)) {
- SetItemState(nIndex, false, true, bScriptModify, true);
+ SetItemState(nIndex, false, true, bScriptModify);
bSetValue = true;
}
int32_t i = 0;
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index e42f29f..0bc03c7 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -388,8 +388,7 @@
void SetItemState(int32_t nIndex,
bool bSelected,
bool bNotify,
- bool bScriptModify,
- bool bSyncData);
+ bool bScriptModify);
WideString GetItemValue(WideStringView wsLabel);