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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.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
Index: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 8b6c0d1fd159e1591b662cb1b693066aaf177443..9076b7ba20a6141ad23531fb1b8d2c6d82c44b90 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -21,7 +21,7 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
int alpha) {
ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
CPDF_Array* pCoords = pDict->GetArray("Coords");
- if (pCoords == NULL) {
+ if (!pCoords) {
return;
}
FX_FLOAT start_x = pCoords->GetNumber(0);
@@ -112,7 +112,7 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
int alpha) {
ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
CPDF_Array* pCoords = pDict->GetArray("Coords");
- if (pCoords == NULL) {
+ if (!pCoords) {
return;
}
FX_FLOAT start_x = pCoords->GetNumber(0);
@@ -834,7 +834,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
int nFuncs = pPattern->m_nFuncs;
CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict();
CPDF_ColorSpace* pColorSpace = pPattern->m_pCS;
- if (pColorSpace == NULL) {
+ if (!pColorSpace) {
return;
}
FX_ARGB background = 0;
@@ -864,7 +864,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
CFX_Matrix FinalMatrix = *pMatrix;
FinalMatrix.Concat(*buffer.GetMatrix());
CFX_DIBitmap* pBitmap = buffer.GetBitmap();
- if (pBitmap->GetBuffer() == NULL) {
+ if (!pBitmap->GetBuffer()) {
return;
}
pBitmap->Clear(background);
@@ -1121,7 +1121,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
m_pContext->m_pDocument, m_pContext->m_pPageCache, pPattern,
pObj2Device, width, height, m_Options.m_Flags);
}
- if (pPatternBitmap == NULL) {
+ if (!pPatternBitmap) {
m_pDevice->RestoreState();
return;
}
@@ -1185,7 +1185,7 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
CPDF_Color* pColor,
FX_BOOL bStroke) {
CPDF_Pattern* pattern = pColor->GetPattern();
- if (pattern == NULL) {
+ if (!pattern) {
return;
}
if (pattern->m_PatternType == PATTERN_TILING) {
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698