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/fde/tto/fde_textout.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fde/tto/fde_textout.cpp') diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 68a68565d1..d7155b7107 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -10,6 +10,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" +#include "third_party/base/ptr_util.h" #include "xfa/fde/cfde_path.h" #include "xfa/fde/fde_gedevice.h" #include "xfa/fde/fde_object.h" @@ -132,12 +133,12 @@ void CFDE_TextOut::SetDIBitmap(CFX_DIBitmap* pDIB) { m_pRenderDevice.reset(); CFX_FxgeDevice* device = new CFX_FxgeDevice; device->Attach(pDIB, false, nullptr, false); - m_pRenderDevice.reset(new CFDE_RenderDevice(device, false)); + m_pRenderDevice = pdfium::MakeUnique(device, false); } void CFDE_TextOut::SetRenderDevice(CFX_RenderDevice* pDevice) { ASSERT(pDevice); - m_pRenderDevice.reset(new CFDE_RenderDevice(pDevice, false)); + m_pRenderDevice = pdfium::MakeUnique(pDevice, false); } void CFDE_TextOut::SetClipRect(const CFX_Rect& rtClip) { -- cgit v1.2.3