From d2cfdd5c72be670aff556c44aaff53df66b23ea6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 10 Dec 2015 15:39:28 -0800 Subject: Merge to XFA: Replace several more CFX_MapPtrToPtr with std::set or std::map Original Review URL: https://codereview.chromium.org/1520643002 . (cherry picked from commit 7db2a535f163e7ce5995da12161ebd0214f0f75a) Original Review URL: https://codereview.chromium.org/1511413008 . (cherry picked from commit 168cfb7ee0f2abbd2bddb7e7d8b430a6d8c6c120) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1515613006 . --- core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/src/fpdfapi/fpdf_parser') diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp index f91ddfa5dc..ad4038d71b 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp @@ -227,11 +227,11 @@ CPDF_Object* CPDF_Object::GetDirect() const { return pRef->m_pObjList->GetIndirectObject(pRef->GetRefObjNum()); } CPDF_Object* CPDF_Object::Clone(FX_BOOL bDirect) const { - CFX_MapPtrToPtr visited; + std::set visited; return CloneInternal(bDirect, &visited); } CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, - CFX_MapPtrToPtr* visited) const { + std::set* visited) const { switch (m_Type) { case PDFOBJ_BOOLEAN: return new CPDF_Boolean(AsBoolean()->m_bValue); @@ -285,8 +285,8 @@ CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, case PDFOBJ_REFERENCE: { const CPDF_Reference* pRef = AsReference(); FX_DWORD obj_num = pRef->GetRefObjNum(); - if (bDirect && !visited->GetValueAt((void*)(uintptr_t)obj_num)) { - visited->SetAt((void*)(uintptr_t)obj_num, (void*)1); + if (bDirect && visited->find(obj_num) == visited->end()) { + visited->insert(obj_num); if (!pRef->GetDirect()) return nullptr; -- cgit v1.2.3