Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2513)

Unified Diff: core/src/fxge/android/fpf_skiafontmgr.cpp

Issue 1084613006: Fix all remaining instances of FX_NEW. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxge/android/fpf_skiafontmgr.cpp
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index a9bef8a2b87d5ddf52964725cebae0ced266ea32..fc012ea9ac21e4450711c7232bf064f029463fbf 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);

Powered by Google App Engine
This is Rietveld 408576698