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

Unified Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: Fix bad search/replace 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: fpdfsdk/fpdf_flatten.cpp
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index fe81246a0b56e401ca575e2d3f6a0dbc551a0b2b..231015201c9f5fe22b57906ad51a980d01a6abc5 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -194,7 +194,8 @@ void SetPageContents(CFX_ByteString key,
if (!pContentsObj) {
// Create a new contents dictionary
if (!key.IsEmpty()) {
- CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+ CPDF_Stream* pNewContents =
+ new CPDF_Stream(nullptr, 0, new CPDF_Dictionary);
pPage->SetAtReference("Contents", pDocument,
pDocument->AddIndirectObject(pNewContents));
@@ -206,7 +207,7 @@ void SetPageContents(CFX_ByteString key,
return;
}
- CPDF_Array* pContentsArray = NULL;
+ CPDF_Array* pContentsArray = nullptr;
switch (pContentsObj->GetType()) {
case CPDF_Object::STREAM: {
@@ -239,7 +240,8 @@ void SetPageContents(CFX_ByteString key,
pPage->SetAtReference("Contents", pDocument, dwObjNum);
if (!key.IsEmpty()) {
- CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+ CPDF_Stream* pNewContents =
+ new CPDF_Stream(nullptr, 0, new CPDF_Dictionary);
dwObjNum = pDocument->AddIndirectObject(pNewContents);
pContentsArray->AddReference(pDocument, dwObjNum);
@@ -376,7 +378,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pPageDict->SetAt("Resources", pRes);
}
- CPDF_Stream* pNewXObject = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+ CPDF_Stream* pNewXObject = new CPDF_Stream(nullptr, 0, new CPDF_Dictionary);
uint32_t dwObjNum = pDocument->AddIndirectObject(pNewXObject);
CPDF_Dictionary* pPageXObject = pRes->GetDictBy("XObject");
if (!pPageXObject) {
@@ -399,7 +401,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
SetPageContents(key, pPageDict, pDocument);
- CPDF_Dictionary* pNewXORes = NULL;
+ CPDF_Dictionary* pNewXORes = nullptr;
if (!key.IsEmpty()) {
pPageXObject->SetAtReference(key, pDocument, dwObjNum);

Powered by Google App Engine
This is Rietveld 408576698