summaryrefslogtreecommitdiff
path: root/core/fxge/android/fpf_skiafontmgr.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 10:46:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:46:23 -0700
commit4997b22f84307521a62838f874928bf56cd3423c (patch)
treead11d99ac0a491ee222e9d0a42ec3b6ad3354e2a /core/fxge/android/fpf_skiafontmgr.cpp
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fxge/android/fpf_skiafontmgr.cpp')
-rw-r--r--core/fxge/android/fpf_skiafontmgr.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp
index 3158f4ca52..8a8cc83fb7 100644
--- a/core/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/fxge/android/fpf_skiafontmgr.cpp
@@ -218,7 +218,7 @@ static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename) {
bsName.MakeLower();
return bsName.Find("arabic") > -1;
}
-CFPF_SkiaFontMgr::CFPF_SkiaFontMgr() : m_bLoaded(FALSE), m_FTLibrary(NULL) {}
+CFPF_SkiaFontMgr::CFPF_SkiaFontMgr() : m_bLoaded(FALSE), m_FTLibrary(nullptr) {}
CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr() {
for (const auto& pair : m_FamilyFonts) {
if (pair.second)
@@ -234,10 +234,9 @@ CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr() {
}
}
FX_BOOL CFPF_SkiaFontMgr::InitFTLibrary() {
- if (!m_FTLibrary) {
+ if (!m_FTLibrary)
FXFT_Init_FreeType(&m_FTLibrary);
- }
- return m_FTLibrary != NULL;
+ return !!m_FTLibrary;
}
void CFPF_SkiaFontMgr::LoadSystemFonts() {
if (m_bLoaded) {
@@ -333,18 +332,18 @@ CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname,
}
pFont->Release();
}
- return NULL;
+ return nullptr;
}
FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead* pFileRead,
int32_t iFaceIndex) {
if (!pFileRead) {
- return NULL;
+ return nullptr;
}
if (pFileRead->GetSize() == 0) {
- return NULL;
+ return nullptr;
}
if (iFaceIndex < 0) {
- return NULL;
+ return nullptr;
}
FXFT_StreamRec streamRec;
FXSYS_memset(&streamRec, 0, sizeof(FXFT_StreamRec));
@@ -357,7 +356,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead* pFileRead,
args.stream = &streamRec;
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
- return NULL;
+ return nullptr;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
@@ -365,10 +364,10 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead* pFileRead,
FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile,
int32_t iFaceIndex) {
if (bsFile.IsEmpty()) {
- return NULL;
+ return nullptr;
}
if (iFaceIndex < 0) {
- return NULL;
+ return nullptr;
}
FXFT_Open_Args args;
args.flags = FT_OPEN_PATHNAME;
@@ -384,10 +383,10 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer,
size_t szBuffer,
int32_t iFaceIndex) {
if (!pBuffer || szBuffer < 1) {
- return NULL;
+ return nullptr;
}
if (iFaceIndex < 0) {
- return NULL;
+ return nullptr;
}
FXFT_Open_Args args;
args.flags = FT_OPEN_MEMORY;