From fa3765cce4da4c3923e525f0462afd794360d221 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 13 Feb 2018 21:44:33 +0000 Subject: Cleanup CFX_XMLNode pointers This CL cleans up hte CFX_XMLNode pointers. Each pointer has been renamed to make the usage clearer, the NodeItems method has been removed in favour of distinct accessors and the node pointers have been made private. Change-Id: I5459a77a0ae93b08741a0cd59266ef9c81ddad75 Reviewed-on: https://pdfium-review.googlesource.com/26550 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fxjs/xfa/cjx_node.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fxjs') diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index e5396b7c90..8009208561 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -246,16 +246,15 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime, } if (bIgnoreRoot) { - CFX_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFX_XMLNode::FirstChild); + CFX_XMLNode* pXMLChild = pXMLNode->GetFirstChild(); while (pXMLChild) { - CFX_XMLNode* pXMLSibling = - pXMLChild->GetNodeItem(CFX_XMLNode::NextSibling); + CFX_XMLNode* pXMLSibling = pXMLChild->GetNextSibling(); pXMLNode->RemoveChildNode(pXMLChild); pFakeXMLRoot->AppendChild(pXMLChild); pXMLChild = pXMLSibling; } } else { - CFX_XMLNode* pXMLParent = pXMLNode->GetNodeItem(CFX_XMLNode::Parent); + CFX_XMLNode* pXMLParent = pXMLNode->GetParent(); if (pXMLParent) pXMLParent->RemoveChildNode(pXMLNode); @@ -291,7 +290,7 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime, CFX_XMLNode* pTempXMLNode = GetXFANode()->GetXMLMappingNode(); GetXFANode()->SetXMLMappingNode(pFakeXMLRoot.release()); GetXFANode()->SetFlag(XFA_NodeFlag_OwnXMLNode, false); - if (pTempXMLNode && !pTempXMLNode->GetNodeItem(CFX_XMLNode::Parent)) + if (pTempXMLNode && !pTempXMLNode->GetParent()) pFakeXMLRoot.reset(pTempXMLNode); else pFakeXMLRoot = nullptr; -- cgit v1.2.3