From 0bb1333a9eff1190ddd68f34c71d6a779c69dfef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Mar 2017 16:12:02 -0400 Subject: Add some calls to MakeUnique This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fwl/cfwl_barcode.cpp | 2 +- xfa/fwl/cfwl_edit.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'xfa/fwl') diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index e894d25d64..bed8921e0e 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -218,7 +218,7 @@ void CFWL_Barcode::CreateBarcodeEngine() { if (m_pBarcodeEngine || m_type == BC_UNKNOWN) return; - std::unique_ptr pBarcode(new CFX_Barcode); + auto pBarcode = pdfium::MakeUnique(); if (pBarcode->Create(m_type)) m_pBarcodeEngine = std::move(pBarcode); } diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index e05f251310..c2b0ddf669 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -566,9 +566,8 @@ void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics, if (!pRenderDev) return; - std::unique_ptr pRenderDevice( - new CFDE_RenderDevice(pRenderDev, false)); - std::unique_ptr pRenderContext(new CFDE_RenderContext); + auto pRenderDevice = pdfium::MakeUnique(pRenderDev, false); + auto pRenderContext = pdfium::MakeUnique(); pRenderDevice->SetClipRect(rtClip); pRenderContext->StartRender(pRenderDevice.get(), pPage, mt); pRenderContext->DoRender(nullptr); -- cgit v1.2.3