From d4db58fa238a3e6f80fc87bc7fe539cd9f54aa7f Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 2 Mar 2017 14:57:59 -0800 Subject: Remove CXFA_NodeStack Also replace CXFA_NodeSet with underlying type. Change-Id: Iba38ef67bab5d7b23a0bb2b8272a1effa1015c9c Reviewed-on: https://pdfium-review.googlesource.com/2905 Reviewed-by: dsinclair Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_document.cpp | 2 +- xfa/fxfa/parser/cxfa_document.h | 3 ++- xfa/fxfa/parser/cxfa_node.cpp | 18 ++++++++++-------- xfa/fxfa/parser/xfa_object.h | 3 --- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index adb8eb2e0b..b7d429aa4a 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -361,7 +361,7 @@ void CXFA_Document::DoProtoMerge() { return; std::map mIDMap; - CXFA_NodeSet sUseNodes; + std::unordered_set sUseNodes; CXFA_NodeIterator sIterator(pTemplateRoot); for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) { diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h index fdd230dca7..b1ee35f07e 100644 --- a/xfa/fxfa/parser/cxfa_document.h +++ b/xfa/fxfa/parser/cxfa_document.h @@ -8,6 +8,7 @@ #define XFA_FXFA_PARSER_CXFA_DOCUMENT_H_ #include +#include #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/xfa_localemgr.h" @@ -118,7 +119,7 @@ class CXFA_Document { CScript_LogPseudoModel* m_pScriptLog; CScript_LayoutPseudoModel* m_pScriptLayout; CScript_SignaturePseudoModel* m_pScriptSignature; - CXFA_NodeSet m_PurgeNodes; + std::unordered_set m_PurgeNodes; XFA_VERSION m_eCurVersionMode; uint32_t m_dwDocFlags; }; diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 1e508969d1..cd6b84424c 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -80,7 +81,7 @@ int32_t GetCount(CXFA_Node* pInstMgrNode) { return iCount; } -void SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, +void SortNodeArrayByDocumentIdx(const std::unordered_set& rgNodeSet, CXFA_NodeArray& rgNodeArray, CFX_ArrayTemplate& rgIdxArray) { int32_t iCount = pdfium::CollectionSize(rgNodeSet); @@ -105,7 +106,8 @@ void SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, } } -using CXFA_NodeSetPair = std::pair; +using CXFA_NodeSetPair = + std::pair, std::unordered_set>; using CXFA_NodeSetPairMap = std::map>; using CXFA_NodeSetPairMapMap = @@ -128,8 +130,8 @@ CXFA_NodeSetPair* NodeSetPairForNode(CXFA_Node* pNode, return (*pNodeSetPairMap)[dwNameHash].get(); } -void ReorderDataNodes(const CXFA_NodeSet& sSet1, - const CXFA_NodeSet& sSet2, +void ReorderDataNodes(const std::unordered_set& sSet1, + const std::unordered_set& sSet2, bool bInsertBefore) { CXFA_NodeSetPairMapMap rgMap; for (CXFA_Node* pNode : sSet1) { @@ -235,8 +237,8 @@ void InsertItem(CXFA_Node* pInstMgrNode, pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent) ->InsertChild(pNewInstance, pNextSibling); if (bMoveDataBindingNodes) { - CXFA_NodeSet sNew; - CXFA_NodeSet sAfter; + std::unordered_set sNew; + std::unordered_set sAfter; CXFA_NodeIteratorTemplate sIteratorNew(pNewInstance); @@ -266,8 +268,8 @@ void InsertItem(CXFA_Node* pInstMgrNode, pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent) ->InsertChild(pNewInstance, pBeforeInstance); if (bMoveDataBindingNodes) { - CXFA_NodeSet sNew; - CXFA_NodeSet sBefore; + std::unordered_set sNew; + std::unordered_set sBefore; CXFA_NodeIteratorTemplate sIteratorNew(pNewInstance); diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index cc116505e0..8bdd264c92 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -8,7 +8,6 @@ #define XFA_FXFA_PARSER_XFA_OBJECT_H_ #include -#include #include "fxjs/cfxjse_arguments.h" #include "xfa/fde/xml/fde_xml.h" @@ -126,8 +125,6 @@ enum XFA_SOM_MESSAGETYPE { }; using CXFA_NodeArray = CFX_ArrayTemplate; -using CXFA_NodeStack = CFX_StackTemplate; -using CXFA_NodeSet = std::unordered_set; typedef void (*PD_CALLBACK_FREEDATA)(void* pData); typedef void (*PD_CALLBACK_DUPLICATEDATA)(void*& pData); -- cgit v1.2.3