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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_image.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_image.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 938a495eb10636798f862b7f64532b33d2539d63..d3390517e96ff9d5f68491452c3eb1e054d2c2fe 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -29,7 +29,7 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
int bitmap_alpha,
int blend_mode,
int Transparency) {
- if (pDIBitmap == NULL) {
+ if (!pDIBitmap) {
return;
}
FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
@@ -353,7 +353,7 @@ FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource() {
return FALSE;
}
FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
- if (m_Loader.m_pBitmap == NULL) {
+ if (!m_Loader.m_pBitmap) {
return FALSE;
}
m_BitmapAlpha = 255;
@@ -363,7 +363,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
}
m_pDIBSource = m_Loader.m_pBitmap;
if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_ALPHA &&
- m_Loader.m_pMask == NULL) {
+ !m_Loader.m_pMask) {
return StartBitmapAlpha();
}
if (pGeneralState && pGeneralState->m_pTR) {
@@ -844,7 +844,7 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) {
return TRUE;
}
CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
- if (pBitmap == NULL) {
+ if (!pBitmap) {
return FALSE;
}
if (pBitmap->IsAlphaMask()) {
@@ -934,11 +934,11 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj,
m_pCS = NULL;
m_Bpp = 3;
CPDF_Object* pCSObj = pDict->GetElementValue("ColorSpace");
- if (pCSObj == NULL) {
+ if (!pCSObj) {
return FALSE;
}
m_pCS = CPDF_ColorSpace::Load(pImageObj->m_pImage->GetDocument(), pCSObj);
- if (m_pCS == NULL) {
+ if (!m_pCS) {
return FALSE;
}
if (!_IsSupported(m_pCS)) {
@@ -995,12 +995,12 @@ FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) {
const uint8_t* src_scan;
if (m_pDecoder) {
src_scan = m_pDecoder->GetScanline(src_y);
- if (src_scan == NULL) {
+ if (!src_scan) {
break;
}
} else {
src_scan = m_StreamAcc.GetData();
- if (src_scan == NULL) {
+ if (!src_scan) {
break;
}
src_scan += src_y * src_pitch;
@@ -1011,7 +1011,7 @@ FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) {
int src_x = (m_bFlipX ? (m_DestWidth - dest_x - 1) : dest_x) * src_width /
m_DestWidth;
const uint8_t* src_pixel = src_scan + src_x * m_Bpp;
- if (m_pCS == NULL) {
+ if (!m_pCS) {
*result_scan = src_pixel[2];
result_scan++;
*result_scan = src_pixel[1];
@@ -1040,7 +1040,7 @@ FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) {
CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_RECT* pClipRect,
const CFX_Matrix* pMatrix) {
- if (pSMaskDict == NULL) {
+ if (!pSMaskDict) {
return NULL;
}
int width = pClipRect->right - pClipRect->left;
@@ -1048,7 +1048,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_BOOL bLuminosity = FALSE;
bLuminosity = pSMaskDict->GetConstString("S") != "Alpha";
CPDF_Stream* pGroup = pSMaskDict->GetStream("G");
- if (pGroup == NULL) {
+ if (!pGroup) {
return NULL;
}
nonstd::unique_ptr<CPDF_Function> pFunc;
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698