summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-30 21:26:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 21:26:51 +0000
commit9daec60824d085db8c2f841fd389c725df1f8b0b (patch)
tree2defab579e0d19a40932780864e1fe30cd5dbb4c /xfa/fxfa/parser/cxfa_document.cpp
parent8b357e7504ea804293983453540ae91c9fc57922 (diff)
downloadpdfium-9daec60824d085db8c2f841fd389c725df1f8b0b.tar.xz
Cleanup XFA packet code
Remove GetPacketByID, move GetPacketByName to the xfa_utils file. Cleanup CreateNode to accept the XFA_XDPPACKET instead of the packet info. Change-Id: I0f246c84f61b6b4175ca307bdcd125d9bc24bb1e Reviewed-on: https://pdfium-review.googlesource.com/20010 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@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.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;