From a9caab94c1f16929e5acf2676117224617d80f53 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 14 Dec 2016 05:57:10 -0800 Subject: 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 --- xfa/fwl/theme/cfwl_widgettp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fwl/theme/cfwl_widgettp.cpp') diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index efc1e96335..3b436d8302 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -9,6 +9,7 @@ #include #include +#include "third_party/base/ptr_util.h" #include "xfa/fde/tto/fde_textout.h" #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fgas/font/cfgas_gefont.h" @@ -173,7 +174,7 @@ void CFWL_WidgetTP::InitTTO() { m_pFDEFont = CFWL_FontManager::GetInstance()->FindFont(FX_WSTRC(L"Helvetica"), 0, 0); - m_pTextOut.reset(new CFDE_TextOut); + m_pTextOut = pdfium::MakeUnique(); m_pTextOut->SetFont(m_pFDEFont); m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize); m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor); @@ -641,7 +642,7 @@ bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ m_pFontMgr = CFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); #else - m_pFontSource.reset(new CFX_FontSourceEnum_File); + m_pFontSource = pdfium::MakeUnique(); m_pFontMgr = CFGAS_FontMgr::Create(m_pFontSource.get()); #endif } -- cgit v1.2.3