From f473672fd6305fe97c749bde3b92e3c9c90e88d0 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 18:10:47 +0000 Subject: Generate XFA node classes This CL adds concrete classes for each of the XFA Node types. Change-Id: Ieac8e2fcd5d13c61daa27fc63e3d80abb7aa7a29 Reviewed-on: https://pdfium-review.googlesource.com/18271 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_document.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_document.cpp') 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 pNode = + CXFA_Node::Create(this, eElement, pPacket->eName); + if (!pNode) return nullptr; - std::unique_ptr pNode = - CXFA_Node::Create(this, pPacket->eName, pElement); // TODO(dsinclair): AddPrugeNode should take ownership of the pointer. AddPurgeNode(pNode.get()); return pNode.release(); -- cgit v1.2.3