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_parser_imp.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa/parser/xfa_parser_imp.cpp') diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 38fdbbb662..20964053f5 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -833,13 +833,12 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, CFDE_XMLElement* pXMLElement = static_cast(pXMLChild); CFX_WideString wsTagName; pXMLElement->GetLocalTagName(wsTagName); - const XFA_ELEMENTINFO* pElemInfo = - XFA_GetElementByName(wsTagName.AsStringC()); - if (!pElemInfo) { + XFA_Element eType = XFA_GetElementTypeForName(wsTagName.AsStringC()); + if (eType == XFA_Element::Unknown) continue; - } + const XFA_PROPERTY* pPropertyInfo = XFA_GetPropertyOfElement( - pXFANode->GetElementType(), pElemInfo->eName, ePacketID); + pXFANode->GetElementType(), eType, ePacketID); if (pPropertyInfo && ((pPropertyInfo->uFlags & (XFA_PROPERTYFLAG_OneOf | XFA_PROPERTYFLAG_DefaultOneOf)) != 0)) { @@ -848,8 +847,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, } bOneOfPropertyFound = TRUE; } - CXFA_Node* pXFAChild = - m_pFactory->CreateNode(ePacketID, pElemInfo->eName); + CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, eType); if (pXFAChild == NULL) { return NULL; } @@ -881,8 +879,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, pXFAChild->SetAttribute(lpAttrInfo->eName, wsAttrValue.AsStringC()); } pXFANode->InsertChild(pXFAChild); - if (pElemInfo->eName == XFA_Element::Validate || - pElemInfo->eName == XFA_Element::Locale) { + if (eType == XFA_Element::Validate || eType == XFA_Element::Locale) { if (ePacketID == XFA_XDPPACKET_Config) { ParseContentNode(pXFAChild, pXMLElement, ePacketID); } else { -- cgit v1.2.3