From 0e606b5ecd6e45f74391f110cc1fe0cce0e80c64 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 18 Nov 2016 16:22:41 -0800 Subject: Make CPDF_Dictionary use unique pointers. Some changes were required to match underlying ctors as invoked by the templated methods. Many release() calls go away, a few WrapUniques() are introduced to avoid going deeper into other code. Review-Url: https://codereview.chromium.org/2510223002 --- core/fpdfdoc/cpvt_fontmap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fpdfdoc/cpvt_fontmap.cpp') diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp index a47595a6ac..283f60011b 100644 --- a/core/fpdfdoc/cpvt_fontmap.cpp +++ b/core/fpdfdoc/cpvt_fontmap.cpp @@ -9,6 +9,7 @@ #include "core/fpdfapi/font/cpdf_font.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" +#include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfdoc/cpdf_interform.h" CPVT_FontMap::CPVT_FontMap(CPDF_Document* pDoc, @@ -39,8 +40,8 @@ void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, CPDF_Dictionary* pFontList = pResDict->GetDictFor("Font"); if (pFontList && !pFontList->KeyExist(sSysFontAlias)) { - pFontList->SetReferenceFor(sSysFontAlias, pDoc, - pPDFFont->GetFontDict()->GetObjNum()); + pFontList->SetNewFor(sSysFontAlias, pDoc, + pPDFFont->GetFontDict()->GetObjNum()); } pSysFont = pPDFFont; } -- cgit v1.2.3