summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_document.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index bdb8d9a0e5..3fc5c39643 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -219,15 +219,14 @@ CXFA_Node* CXFA_Document::CreateNode(uint32_t dwPacket, XFA_Element eElement) {
CXFA_Node* CXFA_Document::CreateNode(const XFA_PACKETINFO* pPacket,
XFA_Element eElement) {
- if (!pPacket)
+ if (!pPacket || eElement == XFA_Element::Unknown)
return nullptr;
- const XFA_ELEMENTINFO* pElement = XFA_GetElementByID(eElement);
- if (!pElement || !(pElement->dwPackets & pPacket->eName))
+ std::unique_ptr<CXFA_Node> pNode =
+ CXFA_Node::Create(this, eElement, pPacket->eName);
+ if (!pNode)
return nullptr;
- std::unique_ptr<CXFA_Node> pNode =
- CXFA_Node::Create(this, pPacket->eName, pElement);
// TODO(dsinclair): AddPrugeNode should take ownership of the pointer.
AddPurgeNode(pNode.get());
return pNode.release();