From 8eb2722e764fff0a39d0d1dc0c59473aa938b31f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 14 Dec 2017 21:04:13 +0000 Subject: Add type information to CJX_Object::GetProperty This CL adds a type template to the CJX_Object::GetProperty method so we can have the correct types returned. Change-Id: Ieda8ec4bd31d26a1e71af30f08b48eb826f5993d Reviewed-on: https://pdfium-review.googlesource.com/21250 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fxjs/xfa/cjx_node.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fxjs/xfa/cjx_node.cpp') diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index 1216177f02..e64f1fd5e7 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -163,8 +163,8 @@ CJS_Return CJX_Node::getElement( WideString expression = runtime->ToWideString(params[0]); int32_t iValue = params.size() >= 2 ? runtime->ToInt32(params[1]) : 0; - CXFA_Node* pNode = - GetProperty(iValue, CXFA_Node::NameToElement(expression), true); + CXFA_Node* pNode = GetProperty( + iValue, CXFA_Node::NameToElement(expression), true); CFXJSE_Value* value = GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode); if (!value) @@ -186,12 +186,12 @@ CJS_Return CJX_Node::isPropertySpecified( bool bParent = params.size() < 2 || runtime->ToBoolean(params[1]); int32_t iIndex = params.size() == 3 ? runtime->ToInt32(params[2]) : 0; XFA_Element eType = CXFA_Node::NameToElement(expression); - bool bHas = !!GetProperty(iIndex, eType, true); + bool bHas = !!GetProperty(iIndex, eType, true); if (!bHas && bParent && GetXFANode()->GetParent()) { // Also check on the parent. auto* jsnode = GetXFANode()->GetParent()->JSObject(); bHas = jsnode->HasAttribute(attr) || - !!jsnode->GetProperty(iIndex, eType, true); + !!jsnode->GetProperty(iIndex, eType, true); } return CJS_Return(runtime->NewBoolean(bHas)); } -- cgit v1.2.3