diff options
author | tsepez <tsepez@chromium.org> | 2016-12-14 05:57:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 05:57:10 -0800 |
commit | a9caab94c1f16929e5acf2676117224617d80f53 (patch) | |
tree | d71ff9a82fae6e6080deb76375f43056127b3ee2 /core/fpdfapi/font/cpdf_cidfont.cpp | |
parent | 992ecf7c189e5cabf43e5ad862511cf63d030966 (diff) | |
download | pdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz |
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the
easy cases.
Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'core/fpdfapi/font/cpdf_cidfont.cpp')
-rw-r--r-- | core/fpdfapi/font/cpdf_cidfont.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp index 0217391c12..91df025e0f 100644 --- a/core/fpdfapi/font/cpdf_cidfont.cpp +++ b/core/fpdfapi/font/cpdf_cidfont.cpp @@ -19,6 +19,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "third_party/base/numerics/safe_math.h" +#include "third_party/base/ptr_util.h" namespace { @@ -398,7 +399,7 @@ bool CPDF_CIDFont::Load() { CPDF_Object* pmap = pCIDFontDict->GetDirectObjectFor("CIDToGIDMap"); if (pmap) { if (CPDF_Stream* pStream = pmap->AsStream()) { - m_pStreamAcc.reset(new CPDF_StreamAcc); + m_pStreamAcc = pdfium::MakeUnique<CPDF_StreamAcc>(); m_pStreamAcc->LoadAllData(pStream, false); } else if (pmap->GetString() == "Identity") { #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ @@ -581,7 +582,7 @@ int CPDF_CIDFont::GetGlyphIndex(uint32_t unicode, bool* pVertGlyph) { if (error || !m_Font.GetSubData()) return index; - m_pTTGSUBTable.reset(new CFX_CTTGSUBTable); + m_pTTGSUBTable = pdfium::MakeUnique<CFX_CTTGSUBTable>(); m_pTTGSUBTable->LoadGSUBTable((FT_Bytes)m_Font.GetSubData()); return GetVerticalGlyph(index, pVertGlyph); } |