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_nodehelper.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/xfa_script_nodehelper.cpp') diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp index 0fd5ff21d5..42f406e48a 100644 --- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp +++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp @@ -376,13 +376,12 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode( XFA_CreateNode_ForCondition(wsCondition); } if (bIsClassName) { - const XFA_ELEMENTINFO* lpElement = XFA_GetElementByName(wsName.AsStringC()); - if (lpElement == NULL) { + XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC()); + if (eType == XFA_Element::Unknown) return FALSE; - } + for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) { - CXFA_Node* pNewNode = - m_pCreateParent->CreateSamePacketNode(lpElement->eName); + CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eType); if (pNewNode) { m_pCreateParent->InsertChild(pNewNode); if (iIndex == m_iCreateCount - 1) { -- cgit v1.2.3