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

Unified Diff: xfa/fxfa/app/xfa_fontmgr.cpp

Issue 2095653002: Remove NULL in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 6 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/fxfa/app/xfa_ffwidgethandler.cpp ('k') | xfa/fxfa/app/xfa_fwltheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_fontmgr.cpp
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index 67f96c4e18099bd49e831484d0fbd7c6406648ec..5bb4ccb81638ccb0359537ffcbf05ed61bf82df5 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,
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidgethandler.cpp ('k') | xfa/fxfa/app/xfa_fwltheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698