summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-04 18:20:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-04 18:20:07 +0000
commit9256ad5784fc437f60fbeb836fe2ecd18e028a5d (patch)
tree484d9e9c4697d50800c574b58d5db4cfa349b27c /fxjs/cjx_node.cpp
parent76e336d26e78f6c6b5cdede6bb4b94ebddf3a2b1 (diff)
downloadpdfium-9256ad5784fc437f60fbeb836fe2ecd18e028a5d.tar.xz
Cleanup ResolveObjects params and return
The return value of ResolveObjects is always used as a boolean, so change from int32_t. The XFA_RESOLVENODE_RS object was made a pointer from a ref. Change-Id: I030036c01101680e36f4ddf524b468354a2e6850 Reviewed-on: https://pdfium-review.googlesource.com/20331 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.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 2865ba4fbf..8bf00f585f 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -411,9 +411,8 @@ void CJX_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent |
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resolveNodeRS;
- int32_t iRet = pScriptContext->ResolveObjects(
- refNode, wsExpression.AsStringView(), resolveNodeRS, dwFlag);
- if (iRet < 1) {
+ if (!pScriptContext->ResolveObjects(refNode, wsExpression.AsStringView(),
+ &resolveNodeRS, dwFlag, nullptr)) {
pArguments->GetReturnValue()->SetNull();
return;
}
@@ -469,13 +468,12 @@ void CJX_Node::ResolveNodeList(CFXJSE_Value* pValue,
CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
if (!pScriptContext)
return;
-
- XFA_RESOLVENODE_RS resolveNodeRS;
if (!refNode)
refNode = GetXFANode();
+ XFA_RESOLVENODE_RS resolveNodeRS;
pScriptContext->ResolveObjects(refNode, wsExpression.AsStringView(),
- resolveNodeRS, dwFlag);
+ &resolveNodeRS, dwFlag, nullptr);
CXFA_ArrayNodeList* pNodeList = new CXFA_ArrayNodeList(GetDocument());
if (resolveNodeRS.dwFlags == XFA_RESOLVENODE_RSTYPE_Nodes) {
for (CXFA_Object* pObject : resolveNodeRS.objects) {
@@ -1236,12 +1234,13 @@ void CJX_Node::Script_Attribute_String(CFXJSE_Value* pValue,
CXFA_Node* pProtoNode = nullptr;
if (!wsSOM.IsEmpty()) {
XFA_RESOLVENODE_RS resolveNodeRS;
- int32_t iRet = GetDocument()->GetScriptContext()->ResolveObjects(
- pProtoRoot, wsSOM.AsStringView(), resolveNodeRS,
+ bool iRet = GetDocument()->GetScriptContext()->ResolveObjects(
+ pProtoRoot, wsSOM.AsStringView(), &resolveNodeRS,
XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes |
XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent |
- XFA_RESOLVENODE_Siblings);
- if (iRet > 0 && resolveNodeRS.objects.front()->IsNode())
+ XFA_RESOLVENODE_Siblings,
+ nullptr);
+ if (iRet && resolveNodeRS.objects.front()->IsNode())
pProtoNode = resolveNodeRS.objects.front()->AsNode();
} else if (!wsID.IsEmpty()) {