diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-17 15:15:08 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-17 15:15:08 -0700 |
commit | 4cb07c9c9cd5761ce3179d3d7254c1cf0efeafa5 (patch) | |
tree | 2549011fbc3d9d6b8415394a5dc6372a2b346b1e /core/src/fxge/android/fpf_skiafontmgr.cpp | |
parent | 48606843d54c5f870d69627afedd574b58d65b3e (diff) | |
download | pdfium-4cb07c9c9cd5761ce3179d3d7254c1cf0efeafa5.tar.xz |
Fix all remaining instances of FX_NEW.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1084613006
Diffstat (limited to 'core/src/fxge/android/fpf_skiafontmgr.cpp')
-rw-r--r-- | core/src/fxge/android/fpf_skiafontmgr.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp index a9bef8a2b8..fc012ea9ac 100644 --- a/core/src/fxge/android/fpf_skiafontmgr.cpp +++ b/core/src/fxge/android/fpf_skiafontmgr.cpp @@ -352,16 +352,12 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, } if (nItem > -1) { CFPF_SkiaFontDescriptor *pFontDes = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(nItem); - CFPF_SkiaFont *pFont = FX_NEW CFPF_SkiaFont; - if (pFont) { - if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); - return pFont->Retain(); - } - pFont->Release(); - pFont = NULL; + CFPF_SkiaFont *pFont = new CFPF_SkiaFont; + if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) { + m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + return pFont->Retain(); } - return pFont; + pFont->Release(); } return NULL; } @@ -464,10 +460,7 @@ void CFPF_SkiaFontMgr::ScanFile(FX_BSTR file) { FXFT_Face face = GetFontFace(file); if (face) { - CFPF_SkiaPathFont *pFontDesc = FX_NEW CFPF_SkiaPathFont; - if (!pFontDesc) { - return; - } + CFPF_SkiaPathFont *pFontDesc = new CFPF_SkiaPathFont; pFontDesc->SetPath(file.GetCStr()); ReportFace(face, pFontDesc); m_FontFaces.Add(pFontDesc); |