summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-04 19:02:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-04 19:02:16 +0000
commitaeb5246e6293a5d25973405f5602c46aa81f7dfd (patch)
treeaf377924d4caf18c36812f86ce0354f0282ea41c /fxjs/cjx_node.cpp
parent9256ad5784fc437f60fbeb836fe2ecd18e028a5d (diff)
downloadpdfium-aeb5246e6293a5d25973405f5602c46aa81f7dfd.tar.xz
Remove CXFA_ValueArray
This CL removes the CXFA_ValueArray. Some of the code in XFA_RESOLVENODE_RS is duplicated, but the duplication makes the code clearer. Change-Id: I7495bb8c614a3d8919bfca858866932774f13fd8 Reviewed-on: https://pdfium-review.googlesource.com/20350 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cjx_node.cpp')
-rw-r--r--fxjs/cjx_node.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 8bf00f585f..9f0a0de998 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -481,11 +481,18 @@ void CJX_Node::ResolveNodeList(CFXJSE_Value* pValue,
pNodeList->Append(pObject->AsNode());
}
} else {
- CXFA_ValueArray valueArray(pScriptContext->GetRuntime());
- if (resolveNodeRS.GetAttributeResult(&valueArray) > 0) {
- for (CXFA_Object* pObject : valueArray.GetAttributeObject()) {
- if (pObject->IsNode())
- pNodeList->Append(pObject->AsNode());
+ if (resolveNodeRS.pScriptAttribute &&
+ resolveNodeRS.pScriptAttribute->eValueType == XFA_ScriptType::Object) {
+ for (CXFA_Object* pObject : resolveNodeRS.objects) {
+ auto pValue =
+ pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetRuntime());
+ CJX_Object* jsObject = pObject->JSObject();
+ (jsObject->*(resolveNodeRS.pScriptAttribute->callback))(
+ pValue.get(), false, resolveNodeRS.pScriptAttribute->attribute);
+
+ CXFA_Object* obj = CFXJSE_Engine::ToObject(pValue.get(), nullptr);
+ if (obj->IsNode())
+ pNodeList->Append(obj->AsNode());
}
}
}