diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
commit | 412e908082a361d0fd9591eab939e96a882212f1 (patch) | |
tree | 11726052ae08f13dc5a05a82cbce870758580aeb /core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | |
parent | 96660d6f382204339d6b1aadc3913303d436e252 (diff) | |
download | pdfium-412e908082a361d0fd9591eab939e96a882212f1.tar.xz |
Merge to XFA: Get rid of most instance of 'foo == NULL'
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
(cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff)
Review URL: https://codereview.chromium.org/1528763003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index a797332727..b200b8d37d 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -17,7 +17,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive* pFile, FX_FILESIZE& offset) { int32_t len = 0; - if (pObj == NULL) { + if (!pObj) { if (pFile->AppendString(" null") < 0) { return -1; } @@ -416,7 +416,7 @@ FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, if (src_size == 0) { return TRUE; } - if (pHandler == NULL) { + if (!pHandler) { m_pData = (uint8_t*)src_data; m_dwSize = src_size; m_bNewBuf = FALSE; @@ -1071,7 +1071,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt) { int32_t len = 0; - if (pObj == NULL) { + if (!pObj) { if (m_File.AppendString(" null") < 0) { return -1; } @@ -1098,7 +1098,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, case PDFOBJ_STRING: { CFX_ByteString str = pObj->GetString(); FX_BOOL bHex = pObj->AsString()->IsHex(); - if (m_pCryptoHandler == NULL || !bEncrypt) { + if (!m_pCryptoHandler || !bEncrypt) { CFX_ByteString content = PDF_EncodeString(str, bHex); if ((len = m_File.AppendString(content)) < 0) { return -1; @@ -1200,7 +1200,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, break; } case PDFOBJ_DICTIONARY: { - if (m_pCryptoHandler == NULL || pObj == m_pEncryptDict) { + if (!m_pCryptoHandler || pObj == m_pEncryptDict) { return PDF_CreatorAppendObject(pObj, &m_File, m_Offset); } if (m_File.AppendString("<<") < 0) { @@ -1263,7 +1263,7 @@ int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) { if (m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) { CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum); - if (pObj == NULL) { + if (!pObj) { m_ObjectOffset[objnum] = 0; m_ObjectSize[objnum] = 0; return 0; @@ -1278,7 +1278,7 @@ int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) { uint8_t* pBuffer; FX_DWORD size; m_pParser->GetIndirectBinary(objnum, pBuffer, size); - if (pBuffer == NULL) { + if (!pBuffer) { return 0; } if (m_pParser->m_V5Type[objnum] == 2) { @@ -1477,7 +1477,7 @@ void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum) { int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause* pPause) { FXSYS_assert(m_iStage > -1 || m_iStage < 20); if (m_iStage == 0) { - if (m_pParser == NULL) { + if (!m_pParser) { m_dwFlags &= ~FPDFCREATE_INCREMENTAL; } if (m_bSecurityChanged && (m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0) { |