From 8d5315004400be520bd988c1789e3b0a800fb100 Mon Sep 17 00:00:00 2001 From: jaepark Date: Fri, 15 Jul 2016 19:25:27 -0700 Subject: Use CPDF_Dictionary::SetAtReference instead of CPDF_Dictionary::AddReference. The definitions of CPDF_Dictionary::SetAtReference and CPDF_Dictionary::AddReference are identical, and AddReference is only used once. So remove CPDF_Dictionary::AddReference method and use CPDF_Dictionary::SetAtReference instead. Review-Url: https://codereview.chromium.org/2161453002 --- core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp | 2 +- core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp | 6 ------ core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp index 7ddc211671..0b87e75f62 100644 --- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp @@ -81,7 +81,7 @@ CFX_ByteString CPDF_PageContentGenerator::RealizeResource( } idnum++; } - pResList->AddReference(name, m_pDocument, pResourceObj->GetObjNum()); + pResList->SetAtReference(name, m_pDocument, pResourceObj->GetObjNum()); return name; } void CPDF_PageContentGenerator::ProcessImage(CFX_ByteTextBuf& buf, diff --git a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp index 4ea8f438bd..78b88a1b2f 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp @@ -214,12 +214,6 @@ void CPDF_Dictionary::SetAtReference(const CFX_ByteString& key, SetAt(key, new CPDF_Reference(pDoc, objnum)); } -void CPDF_Dictionary::AddReference(const CFX_ByteString& key, - CPDF_IndirectObjectHolder* pDoc, - uint32_t objnum) { - SetAt(key, new CPDF_Reference(pDoc, objnum)); -} - void CPDF_Dictionary::SetAtNumber(const CFX_ByteString& key, FX_FLOAT f) { SetAt(key, new CPDF_Number(f)); } diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h index 41cec0cda2..29846366d9 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h @@ -71,10 +71,6 @@ class CPDF_Dictionary : public CPDF_Object { void SetAtMatrix(const CFX_ByteString& key, const CFX_Matrix& matrix); void SetAtBoolean(const CFX_ByteString& key, bool bValue); - void AddReference(const CFX_ByteString& key, - CPDF_IndirectObjectHolder* pDoc, - uint32_t objnum); - // Invalidates iterators for the element with the key |key|. void RemoveAt(const CFX_ByteString& key); -- cgit v1.2.3