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.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 3fc5c39643..4e230ee87b 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -213,17 +213,14 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) {
}
}
-CXFA_Node* CXFA_Document::CreateNode(uint32_t dwPacket, XFA_Element eElement) {
- return CreateNode(XFA_GetPacketByID(dwPacket), eElement);
-}
-
-CXFA_Node* CXFA_Document::CreateNode(const XFA_PACKETINFO* pPacket,
+CXFA_Node* CXFA_Document::CreateNode(XFA_XDPPACKET packet,
XFA_Element eElement) {
- if (!pPacket || eElement == XFA_Element::Unknown)
+ if (packet == XFA_XDPPACKET_UNKNOWN || packet >= XFA_XDPPACKET_LAST ||
+ eElement == XFA_Element::Unknown) {
return nullptr;
+ }
- std::unique_ptr<CXFA_Node> pNode =
- CXFA_Node::Create(this, eElement, pPacket->eName);
+ std::unique_ptr<CXFA_Node> pNode = CXFA_Node::Create(this, eElement, packet);
if (!pNode)
return nullptr;