Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: xfa/fxfa/parser/xfa_document_datamerger_imp.cpp

Issue 2612923002: Remove CFX_MapPtrToPtr from xfa/fxfa. (Closed)
Patch Set: endless loop Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_scriptcontext.cpp ('k') | xfa/fxfa/parser/xfa_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index dab61e65d8257bee3d234d896019aecbfb1d1dfe..f1b60884eea40b919968813124d30b8214af9165 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -6,6 +6,7 @@
#include "xfa/fxfa/parser/xfa_document_datamerger_imp.h"
+#include <map>
#include <vector>
#include "core/fxcrt/fx_ext.h"
@@ -356,15 +357,14 @@ void CreateDataBinding(CXFA_Node* pFormNode,
}
CXFA_Node* GetGlobalBinding(CXFA_Document* pDocument, uint32_t dwNameHash) {
- CXFA_Node* pNode = nullptr;
- pDocument->m_rgGlobalBinding.Lookup(dwNameHash, pNode);
- return pNode;
+ auto it = pDocument->m_rgGlobalBinding.find(dwNameHash);
+ return it != pDocument->m_rgGlobalBinding.end() ? it->second : nullptr;
}
void RegisterGlobalBinding(CXFA_Document* pDocument,
uint32_t dwNameHash,
CXFA_Node* pDataNode) {
- pDocument->m_rgGlobalBinding.SetAt(dwNameHash, pDataNode);
+ pDocument->m_rgGlobalBinding[dwNameHash] = pDataNode;
}
CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope,
@@ -753,7 +753,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
if (eType == XFA_Element::SubformSet || eType == XFA_Element::Area) {
sNodeIterator.MoveToNext();
} else {
- CFX_MapPtrTemplate<CXFA_Node*, CXFA_Node*> subformMapArray;
+ std::map<CXFA_Node*, CXFA_Node*> subformMapArray;
CXFA_NodeArray nodeArray;
for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) {
bool bSelfMatch = false;
@@ -772,15 +772,16 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
CreateDataBinding(pSubformNode, pDataNode, true);
ASSERT(pSubformNode);
- subformMapArray.SetAt(pSubformNode, pDataNode);
+ subformMapArray[pSubformNode] = pDataNode;
nodeArray.Add(pSubformNode);
}
- subformMapArray.GetStartPosition();
for (int32_t iIndex = 0; iIndex < nodeArray.GetSize(); iIndex++) {
CXFA_Node* pSubform = nodeArray[iIndex];
- CXFA_Node* pDataNode =
- reinterpret_cast<CXFA_Node*>(subformMapArray.GetValueAt(pSubform));
+ CXFA_Node* pDataNode = nullptr;
+ auto it = subformMapArray.find(pSubform);
+ if (it != subformMapArray.end())
+ pDataNode = it->second;
for (CXFA_Node* pTemplateChild =
pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(
@@ -794,7 +795,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
}
}
}
- subformMapArray.RemoveAll();
+ subformMapArray.clear();
}
for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) {
@@ -1521,7 +1522,7 @@ void CXFA_Document::DoDataRemerge(bool bDoDataMerge) {
pFormRoot->RemoveChild(pNode);
pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr);
}
- m_rgGlobalBinding.RemoveAll();
+ m_rgGlobalBinding.clear();
if (bDoDataMerge)
DoDataMerge();
« no previous file with comments | « xfa/fxfa/parser/cxfa_scriptcontext.cpp ('k') | xfa/fxfa/parser/xfa_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698