From 6e12478cb298c3a8277493ee79ae0b73d6df8554 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 23 Jun 2016 12:14:55 -0700 Subject: Change XFA_GetElementByName to XFA_GetElementTypeForName This method was only ever used to get the XFA_Element type for the given element name. Changed to make the signature match the usage. Review-Url: https://codereview.chromium.org/2095733002 --- xfa/fxfa/parser/xfa_script_imp.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xfa/fxfa/parser/xfa_script_imp.cpp') diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index ee7576ebf1..2afa5fcdec 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -319,13 +319,12 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, } CXFA_Node* pNode = ToNode(pObject); CXFA_Node* pPropOrChild = nullptr; - const XFA_ELEMENTINFO* lpElementInfo = - XFA_GetElementByName(wsPropName.AsStringC()); - if (lpElementInfo) { - pPropOrChild = pNode->GetProperty(0, lpElementInfo->eName); - } else { + XFA_Element eType = XFA_GetElementTypeForName(wsPropName.AsStringC()); + if (eType != XFA_Element::Unknown) + pPropOrChild = pNode->GetProperty(0, eType); + else pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsStringC()); - } + if (pPropOrChild) { CFX_WideString wsDefaultName(L"{default}"); const XFA_SCRIPTATTRIBUTEINFO* lpAttrInfo = -- cgit v1.2.3