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

Unified Diff: xfa/src/fgas/src/font/fx_stdfontmgr.cpp

Issue 1377853004: XFA: Remove test for new. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: nit Created 5 years, 2 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
« no previous file with comments | « xfa/src/fgas/src/crt/fx_stream.cpp ('k') | xfa/src/fxbarcode/BC_Writer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fgas/src/font/fx_stdfontmgr.cpp
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
index a3769140cc04c3e8d9c8211938c669e9f873ddc4..f339555c6b3936fa61de4fde757c75db0f07e850 100644
--- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
+++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
@@ -131,9 +131,6 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(
return NULL;
}
CFX_Font* pFXFont = new CFX_Font;
- if (pFXFont == NULL) {
- return NULL;
- }
pFXFont->m_Face = ftFace;
pFXFont->m_pFontData = FXFT_Get_Face_Stream_Base(ftFace);
pFXFont->m_dwSize = FXFT_Get_Face_Stream_Size(ftFace);
@@ -601,9 +598,6 @@ IFX_FontMgr* IFX_FontMgr::Create(IFX_FontSourceEnum* pFontEnum,
}
CFX_FontMgrImp* pFontMgr =
new CFX_FontMgrImp(pFontEnum, pDelegate, pUserData);
- if (NULL == pFontMgr) {
- return NULL;
- }
if (pFontMgr->EnumFonts()) {
return pFontMgr;
}
@@ -756,12 +750,8 @@ IFX_Font* CFX_FontMgrImp::GetFontByCodePage(FX_WORD wCodePage,
return pFonts->GetAt(0)->Retain();
}
}
- if (NULL == pFonts) {
+ if (!pFonts)
pFonts = new CFX_ArrayTemplate<IFX_Font*>;
- }
- if (NULL == pFonts) {
- return NULL;
- }
m_Hash2Fonts.SetAt(dwHash, pFonts);
CFX_FontDescriptorInfos* sortedFonts = NULL;
if (!m_Hash2CandidateList.Lookup(dwHash, sortedFonts)) {
@@ -818,12 +808,8 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode,
}
}
}
- if (NULL == pFonts) {
+ if (!pFonts)
pFonts = new CFX_ArrayTemplate<IFX_Font*>;
- }
- if (NULL == pFonts) {
- return NULL;
- }
m_Hash2Fonts.SetAt(dwHash, pFonts);
CFX_FontDescriptorInfos* sortedFonts = NULL;
if (!m_Hash2CandidateList.Lookup(dwHash, sortedFonts)) {
@@ -974,9 +960,6 @@ IFX_Font* CFX_FontMgrImp::LoadFont(IFX_FileAccess* pFontAccess,
}
}
CFX_Font* pInternalFont = new CFX_Font;
- if (NULL == pInternalFont) {
- return NULL;
- }
IFX_FileRead* pFontStream =
pFontAccess->CreateFileStream(FX_FILEMODE_ReadOnly);
if (NULL == pFontStream) {
@@ -1277,9 +1260,6 @@ void CFX_FontMgrImp::ReportFace(FXFT_Face pFace,
return;
}
CFX_FontDescriptor* pFont = new CFX_FontDescriptor;
- if (NULL == pFont) {
- return;
- }
pFont->m_dwFontStyles |= FXFT_Is_Face_Bold(pFace) ? FX_FONTSTYLE_Bold : 0;
pFont->m_dwFontStyles |= FXFT_Is_Face_Italic(pFace) ? FX_FONTSTYLE_Italic : 0;
pFont->m_dwFontStyles |= GetFlags(pFace);
« no previous file with comments | « xfa/src/fgas/src/crt/fx_stream.cpp ('k') | xfa/src/fxbarcode/BC_Writer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698