summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-03 15:24:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-03 15:24:27 -0700
commit36eb4bdcae719cf33c536ff72ac000482aed8382 (patch)
treeb3c3467fa10eafc3863a619ef511d1bf20af6367 /core/fxge/ge
parent76383db4906c9357292846ace77566b34eb47de9 (diff)
downloadpdfium-36eb4bdcae719cf33c536ff72ac000482aed8382.tar.xz
Add ptr_util.h from base until std::make_unique<> available
Review-Url: https://codereview.chromium.org/2386273004
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/cfx_font.cpp5
-rw-r--r--core/fxge/ge/cfx_fontmgr.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp
index 737d7c450b..e957b219f4 100644
--- a/core/fxge/ge/cfx_font.cpp
+++ b/core/fxge/ge/cfx_font.cpp
@@ -15,6 +15,7 @@
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fx_freetype.h"
#include "core/fxge/ge/fx_text_int.h"
+#include "third_party/base/ptr_util.h"
#define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em)
@@ -244,7 +245,7 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) {
m_bShallowCopy = true;
if (pFont->m_pSubstFont) {
- m_pSubstFont = WrapUnique(new CFX_SubstFont);
+ m_pSubstFont = pdfium::MakeUnique<CFX_SubstFont>();
m_pSubstFont->m_Charset = pFont->m_pSubstFont->m_Charset;
m_pSubstFont->m_SubstFlags = pFont->m_pSubstFont->m_SubstFlags;
m_pSubstFont->m_Weight = pFont->m_pSubstFont->m_Weight;
@@ -319,7 +320,7 @@ void CFX_Font::LoadSubst(const CFX_ByteString& face_name,
bool bVertical) {
m_bEmbedded = false;
m_bVertical = bVertical;
- m_pSubstFont = WrapUnique(new CFX_SubstFont);
+ m_pSubstFont = pdfium::MakeUnique<CFX_SubstFont>();
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(
face_name, bTrueType, flags, weight, italic_angle, CharsetCP,
m_pSubstFont.get());
diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp
index 54000e6b5d..95a2b662ed 100644
--- a/core/fxge/ge/cfx_fontmgr.cpp
+++ b/core/fxge/ge/cfx_fontmgr.cpp
@@ -12,6 +12,7 @@
#include "core/fxge/fx_font.h"
#include "core/fxge/ge/cttfontdesc.h"
#include "core/fxge/ifx_systemfontinfo.h"
+#include "third_party/base/ptr_util.h"
namespace {
@@ -81,7 +82,7 @@ int GetTTCIndex(const uint8_t* pFontData,
CFX_FontMgr::CFX_FontMgr()
: m_FTLibrary(nullptr), m_FTLibrarySupportsHinting(false) {
- m_pBuiltinMapper = WrapUnique(new CFX_FontMapper(this));
+ m_pBuiltinMapper = pdfium::MakeUnique<CFX_FontMapper>(this);
}
CFX_FontMgr::~CFX_FontMgr() {