From 9daec60824d085db8c2f841fd389c725df1f8b0b Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Nov 2017 21:26:51 +0000 Subject: 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 Reviewed-by: Lei Zhang Commit-Queue: dsinclair --- fxjs/cjx_node.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'fxjs') diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp index 3442b35b9d..cdf89848f8 100644 --- a/fxjs/cjx_node.cpp +++ b/fxjs/cjx_node.cpp @@ -3522,7 +3522,6 @@ pdfium::Optional CJX_Node::TryNamespace() { CXFA_Node* CJX_Node::GetProperty(int32_t index, XFA_Element eProperty, bool bCreateProperty) { - uint32_t dwPacket = GetXFANode()->GetPacketID(); if (index < 0 || index >= GetXFANode()->PropertyOccuranceCount(eProperty)) return nullptr; @@ -3548,10 +3547,10 @@ CXFA_Node* CJX_Node::GetProperty(int32_t index, } } - const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket); CXFA_Node* pNewNode = nullptr; - for (; iCount <= index; iCount++) { - pNewNode = GetDocument()->CreateNode(pPacket, eProperty); + for (; iCount <= index; ++iCount) { + pNewNode = + GetDocument()->CreateNode(GetXFANode()->GetPacketID(), eProperty); if (!pNewNode) return nullptr; GetXFANode()->InsertChild(pNewNode, nullptr); -- cgit v1.2.3