diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-05-01 11:39:33 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-01 19:09:28 +0000 |
commit | a0a69233cafa0ec22fd6c776851e3ee069ca66bf (patch) | |
tree | d19383094f925441de83f554c9e591f5807ea2d7 /core/fxge/ge/fx_ge_linux.cpp | |
parent | b8e00f24780335cdd068565f39d2874c81e799b9 (diff) | |
download | pdfium-a0a69233cafa0ec22fd6c776851e3ee069ca66bf.tar.xz |
Remove more |new|s, part 5
Many of these are already unique_ptrs.
Change-Id: I3695d4ff5a8f7483ad994ac7657897fd55069cd5
Reviewed-on: https://pdfium-review.googlesource.com/4690
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/ge/fx_ge_linux.cpp')
-rw-r--r-- | core/fxge/ge/fx_ge_linux.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp index b216e12127..4e4b2050e9 100644 --- a/core/fxge/ge/fx_ge_linux.cpp +++ b/core/fxge/ge/fx_ge_linux.cpp @@ -5,11 +5,13 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include <memory> +#include <utility> #include "core/fxcrt/fx_codepage.h" #include "core/fxge/cfx_gemodule.h" #include "core/fxge/ge/cfx_folderfontinfo.h" #include "core/fxge/ifx_systemfontinfo.h" +#include "third_party/base/ptr_util.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ namespace { @@ -145,14 +147,14 @@ bool CFX_LinuxFontInfo::ParseFontCfg(const char** pUserPaths) { std::unique_ptr<IFX_SystemFontInfo> IFX_SystemFontInfo::CreateDefault( const char** pUserPaths) { - CFX_LinuxFontInfo* pInfo = new CFX_LinuxFontInfo; + auto pInfo = pdfium::MakeUnique<CFX_LinuxFontInfo>(); if (!pInfo->ParseFontCfg(pUserPaths)) { pInfo->AddPath("/usr/share/fonts"); pInfo->AddPath("/usr/share/X11/fonts/Type1"); pInfo->AddPath("/usr/share/X11/fonts/TTF"); pInfo->AddPath("/usr/local/share/fonts"); } - return std::unique_ptr<IFX_SystemFontInfo>(pInfo); + return std::move(pInfo); } void CFX_GEModule::InitPlatform() { |