diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-23 12:14:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-23 12:14:55 -0700 |
commit | 6e12478cb298c3a8277493ee79ae0b73d6df8554 (patch) | |
tree | 46e28dbab97bbe41cca67ace9a3a05429c9cd519 /xfa/fxfa/parser/xfa_parser_imp.cpp | |
parent | f7f659c2c98a4d02e3695266d33f449b7be01af9 (diff) | |
download | pdfium-6e12478cb298c3a8277493ee79ae0b73d6df8554.tar.xz |
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
Diffstat (limited to 'xfa/fxfa/parser/xfa_parser_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_parser_imp.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
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<CFDE_XMLElement*>(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 { |