summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-27 18:10:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-27 18:10:47 +0000
commitf473672fd6305fe97c749bde3b92e3c9c90e88d0 (patch)
treefe1ec0af4f66a801c7a08fd762e61b065b89d4ec /xfa/fxfa/parser/cxfa_document.cpp
parent3636a854af15219fd679ed54207abcdad3283b9b (diff)
downloadpdfium-f473672fd6305fe97c749bde3b92e3c9c90e88d0.tar.xz
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 <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
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();