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

Unified Diff: fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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 | « core/src/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/src/fpdf_dataavail.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 743c90e817a74e2e708c56176fac99f9876d7229..dd58180e61a4a9e2ab625cd27a9a898538223757 100644
--- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
@@ -122,7 +122,7 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
ASSERT(pDocument != NULL);
CPDF_Dictionary* pFonts = pResDict->GetDict("Font");
- if (pFonts == NULL)
+ if (!pFonts)
return NULL;
CPDF_Font* pFind = NULL;
@@ -132,7 +132,7 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CPDF_Object* pObj = NULL;
CFX_ByteString csKey;
pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL)
+ if (!pObj)
continue;
CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
@@ -142,10 +142,10 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
continue;
CPDF_Font* pFont = pDocument->LoadFont(pElement);
- if (pFont == NULL)
+ if (!pFont)
continue;
const CFX_SubstFont* pSubst = pFont->GetSubstFont();
- if (pSubst == NULL)
+ if (!pSubst)
continue;
if (pSubst->m_Charset == nCharset) {
sFontAlias = csKey;
@@ -170,7 +170,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP");
- if (pAPDict == NULL) {
+ if (!pAPDict) {
pAPDict = new CPDF_Dictionary;
m_pAnnotDict->SetAt("AP", pAPDict);
}
@@ -181,7 +181,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
return;
CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType);
- if (pStream == NULL) {
+ if (!pStream) {
pStream = new CPDF_Stream(NULL, 0, NULL);
int32_t objnum = m_pDocument->AddIndirectObject(pStream);
pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum);
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/src/fpdf_dataavail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698