From 026623249c78ba305c874cc093a035ef5a4cd1b4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Apr 2015 08:31:30 -0700 Subject: Remove checks in fxge/ge now that FX_NEW can't return 0. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1081443004 --- core/src/fxge/ge/fx_ge_fontmap.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'core/src/fxge/ge/fx_ge_fontmap.cpp') diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 079c485b01..43b971ffc3 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -61,10 +61,7 @@ FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face) } CFX_FontMgr::CFX_FontMgr() { - m_pBuiltinMapper = FX_NEW CFX_FontMapper; - if (!m_pBuiltinMapper) { - return; - } + m_pBuiltinMapper = new CFX_FontMapper; m_pBuiltinMapper->m_pFontMgr = this; m_pExtMapper = NULL; m_FTLibrary = NULL; @@ -136,10 +133,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name, FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index) { - CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc; - if (!pFontDesc) { - return NULL; - } + CTTFontDesc* pFontDesc = new CTTFontDesc; pFontDesc->m_Type = 1; pFontDesc->m_SingleFace.m_pFace = NULL; pFontDesc->m_SingleFace.m_bBold = weight; @@ -337,10 +331,7 @@ FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, FX_DWORD checksum, { CFX_ByteString key; key.Format("%d:%d", ttc_size, checksum); - CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc; - if (!pFontDesc) { - return NULL; - } + CTTFontDesc* pFontDesc = new CTTFontDesc; pFontDesc->m_Type = 2; pFontDesc->m_pFontData = pData; for (int i = 0; i < 16; i ++) { @@ -1416,10 +1407,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_ if (m_FontList.Lookup(facename, p)) { return; } - CFontFaceInfo* pInfo = FX_NEW CFontFaceInfo; - if (!pInfo) { - return; - } + CFontFaceInfo* pInfo = new CFontFaceInfo; pInfo->m_FilePath = path; pInfo->m_FaceName = facename; pInfo->m_FontTables = tables; -- cgit v1.2.3