summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_fontmgr.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-23 12:40:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-23 12:40:16 -0700
commit85d1f2c2f9f1e746bedb1b6f03576613f54fbc27 (patch)
treeff5b393fb9b89f006327bee7bc8c955522defb67 /xfa/fxfa/app/xfa_fontmgr.cpp
parent6e12478cb298c3a8277493ee79ae0b73d6df8554 (diff)
downloadpdfium-85d1f2c2f9f1e746bedb1b6f03576613f54fbc27.tar.xz
Remove NULL in xfa/
This CL converts all NULL's to nullptr. All instances of comparison to nullptr have been removed. Review-Url: https://codereview.chromium.org/2095653002
Diffstat (limited to 'xfa/fxfa/app/xfa_fontmgr.cpp')
-rw-r--r--xfa/fxfa/app/xfa_fontmgr.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index 67f96c4e18..5bb4ccb816 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -1722,7 +1722,7 @@ const XFA_FONTINFO* XFA_GetFontINFOByFontName(
int32_t iStart = 0;
int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
int32_t iMid = 0;
- const XFA_FONTINFO* pFontInfo = NULL;
+ const XFA_FONTINFO* pFontInfo = nullptr;
do {
iMid = (iStart + iEnd) / 2;
uint32_t dwFontNameHash = g_XFAFontsMap[iMid].dwFontNameHash;
@@ -1798,9 +1798,11 @@ CFGAS_GEFont* CXFA_DefFontMgr::GetDefaultFont(
IFGAS_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr();
CFGAS_GEFont* pFont =
pFDEFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage);
- if (!pFont)
- pFont =
- pFDEFontMgr->LoadFont((const FX_WCHAR*)NULL, dwFontStyles, wCodePage);
+ if (!pFont) {
+ pFont = pFDEFontMgr->LoadFont((const FX_WCHAR*)nullptr, dwFontStyles,
+ wCodePage);
+ }
+
ASSERT(pFont);
if (pFont) {
m_CacheFonts.Add(pFont);
@@ -1834,17 +1836,17 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName,
CPDF_Font** pDstPDFFont,
FX_BOOL bStrictMatch) {
CPDF_Document* pDoc = m_pDoc->GetPDFDoc();
- if (pDoc == NULL) {
- return NULL;
+ if (!pDoc) {
+ return nullptr;
}
CPDF_Dictionary* pFontSetDict =
pDoc->GetRoot()->GetDictBy("AcroForm")->GetDictBy("DR");
if (!pFontSetDict) {
- return NULL;
+ return nullptr;
}
pFontSetDict = pFontSetDict->GetDictBy("Font");
if (!pFontSetDict) {
- return NULL;
+ return nullptr;
}
strPsName.Remove(' ');
IFGAS_FontMgr* pFDEFontMgr = m_pDoc->GetApp()->GetFDEFontMgr();
@@ -1857,19 +1859,19 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName,
}
CPDF_Dictionary* pFontDict = ToDictionary(pObj->GetDirect());
if (!pFontDict || pFontDict->GetStringBy("Type") != "Font") {
- return NULL;
+ return nullptr;
}
CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict);
if (!pPDFFont) {
- return NULL;
+ return nullptr;
}
if (!pPDFFont->IsEmbedded()) {
*pDstPDFFont = pPDFFont;
- return NULL;
+ return nullptr;
}
return CFGAS_GEFont::LoadFont(&pPDFFont->m_Font, pFDEFontMgr);
}
- return NULL;
+ return nullptr;
}
CFGAS_GEFont* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily,