summaryrefslogtreecommitdiff
path: root/core/fxge/android
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
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')
-rw-r--r--core/fxge/android/fpf_skiafontmgr.cpp25
-rw-r--r--core/fxge/android/fpf_skiafontmgr.h8
-rw-r--r--core/fxge/android/fx_android_font.cpp2
3 files changed, 17 insertions, 18 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;
diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h
index be3ea460da..ec27a7fb21 100644
--- a/core/fxge/android/fpf_skiafontmgr.h
+++ b/core/fxge/android/fpf_skiafontmgr.h
@@ -28,7 +28,7 @@ class CFPF_SkiaFont;
class CFPF_SkiaFontDescriptor {
public:
CFPF_SkiaFontDescriptor()
- : m_pFamily(NULL),
+ : m_pFamily(nullptr),
m_dwStyle(0),
m_iFaceIndex(0),
m_dwCharsets(0),
@@ -53,7 +53,7 @@ class CFPF_SkiaFontDescriptor {
class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
public:
- CFPF_SkiaPathFont() : m_pPath(NULL) {}
+ CFPF_SkiaPathFont() : m_pPath(nullptr) {}
~CFPF_SkiaPathFont() override { FX_Free(m_pPath); }
// CFPF_SkiaFontDescriptor
@@ -71,7 +71,7 @@ class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor {
public:
- CFPF_SkiaFileFont() : m_pFile(NULL) {}
+ CFPF_SkiaFileFont() : m_pFile(nullptr) {}
// CFPF_SkiaFontDescriptor
int32_t GetType() const override { return FPF_SKIAFONTTYPE_File; }
@@ -80,7 +80,7 @@ class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor {
class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor {
public:
- CFPF_SkiaBufferFont() : m_pBuffer(NULL), m_szBuffer(0) {}
+ CFPF_SkiaBufferFont() : m_pBuffer(nullptr), m_szBuffer(0) {}
// CFPF_SkiaFontDescriptor
int32_t GetType() const override { return FPF_SKIAFONTTYPE_Buffer; }
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp
index b1606bbd69..3246eb7f9e 100644
--- a/core/fxge/android/fx_android_font.cpp
+++ b/core/fxge/android/fx_android_font.cpp
@@ -12,7 +12,7 @@
#include "core/fxge/android/fpf_skiafontmgr.h"
#include "core/fxge/android/fx_android_font.h"
-CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(NULL) {}
+CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(nullptr) {}
FX_BOOL CFX_AndroidFontInfo::Init(CFPF_SkiaFontMgr* pFontMgr) {
if (!pFontMgr)
return FALSE;