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

Unified Diff: core/fpdfapi/fpdf_page/cpdf_image.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: s/NULL/nullptr/ Created 4 years, 7 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
Index: core/fpdfapi/fpdf_page/cpdf_image.cpp
diff --git a/core/fpdfapi/fpdf_page/cpdf_image.cpp b/core/fpdfapi/fpdf_page/cpdf_image.cpp
index 84f6853b580ee04f0c2f4b459c7886308869e6a9..f054ce3b77613b86a931aaf6436082f2078d4c8e 100644
--- a/core/fpdfapi/fpdf_page/cpdf_image.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_image.cpp
@@ -58,7 +58,7 @@ FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) {
m_pStream = pStream;
if (m_bInline && m_pInlineDict) {
m_pInlineDict->Release();
- m_pInlineDict = NULL;
+ m_pInlineDict = nullptr;
}
m_bInline = bInline;
CPDF_Dictionary* pDict = pStream->GetDict();
@@ -82,14 +82,14 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
FX_BOOL color_trans;
if (!CPDF_ModuleMgr::Get()->GetJpegModule()->LoadInfo(
pData, size, width, height, num_comps, bits, color_trans)) {
- return NULL;
+ return nullptr;
}
CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName("Type", "XObject");
pDict->SetAtName("Subtype", "Image");
pDict->SetAtInteger("Width", width);
pDict->SetAtInteger("Height", height);
- const FX_CHAR* csname = NULL;
+ const FX_CHAR* csname = nullptr;
if (num_comps == 1) {
csname = "DeviceGray";
} else if (num_comps == 3) {
@@ -115,7 +115,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
m_Width = width;
m_Height = height;
if (!m_pStream) {
- m_pStream = new CPDF_Stream(NULL, 0, NULL);
+ m_pStream = new CPDF_Stream(nullptr, 0, nullptr);
}
return pDict;
}
@@ -168,7 +168,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
pDict->SetAtName("Subtype", "Image");
pDict->SetAtInteger("Width", BitmapWidth);
pDict->SetAtInteger("Height", BitmapHeight);
- uint8_t* dest_buf = NULL;
+ uint8_t* dest_buf = nullptr;
FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1;
if (bpp == 1) {
int32_t reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0;
@@ -252,7 +252,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
opType = 0;
}
}
- const CFX_DIBitmap* pMaskBitmap = NULL;
+ const CFX_DIBitmap* pMaskBitmap = nullptr;
FX_BOOL bDeleteMask = FALSE;
if (pBitmap->HasAlpha()) {
pMaskBitmap = pBitmap->GetAlphaMask();
@@ -261,7 +261,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
if (pMaskBitmap) {
int32_t maskWidth = pMaskBitmap->GetWidth();
int32_t maskHeight = pMaskBitmap->GetHeight();
- uint8_t* mask_buf = NULL;
+ uint8_t* mask_buf = nullptr;
FX_STRSIZE mask_size = 0;
CPDF_Dictionary* pMaskDict = new CPDF_Dictionary;
pMaskDict->SetAtName("Type", "XObject");
@@ -301,10 +301,10 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
SetImage(pNewBitmap, iCompress);
if (pDict) {
pDict->Release();
- pDict = NULL;
+ pDict = nullptr;
}
FX_Free(dest_buf);
- dest_buf = NULL;
+ dest_buf = nullptr;
dest_size = 0;
delete pNewBitmap;
return;
@@ -343,7 +343,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
}
}
if (!m_pStream) {
- m_pStream = new CPDF_Stream(NULL, 0, NULL);
+ m_pStream = new CPDF_Stream(nullptr, 0, nullptr);
}
m_pStream->InitStream(dest_buf, dest_size, pDict);
m_bIsMask = pBitmap->IsAlphaMask();

Powered by Google App Engine
This is Rietveld 408576698