summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_basic.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 18:10:25 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 18:10:25 -0800
commite3c7c2b54348da4a6939f6672f6c6bff126815a7 (patch)
tree68cc9bebdd5f4f055bfa7de116862091709b4054 /core/src/fpdfdoc/doc_basic.cpp
parentba41a35553573ab718026e8508e1e32107db6595 (diff)
downloadpdfium-e3c7c2b54348da4a6939f6672f6c6bff126815a7.tar.xz
Get rid of most instance of 'foo != NULL'
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 .
Diffstat (limited to 'core/src/fpdfdoc/doc_basic.cpp')
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 904ccf7c1f..c58e10b779 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -77,7 +77,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
return NULL;
}
CPDF_Array* pLimits = pNode->GetArray("Limits");
- if (pLimits != NULL) {
+ if (pLimits) {
CFX_ByteString csLeft = pLimits->GetString(0);
CFX_ByteString csRight = pLimits->GetString(1);
if (csLeft.Compare(csRight) > 0) {
@@ -96,7 +96,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
CFX_ByteString csValue = pNames->GetString(i * 2);
int32_t iCompare = csValue.Compare(csName);
if (iCompare <= 0) {
- if (ppFind != NULL) {
+ if (ppFind) {
*ppFind = pNames;
}
if (iCompare < 0) {
@@ -144,7 +144,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
nCurIndex += nCount;
return NULL;
}
- if (ppFind != NULL) {
+ if (ppFind) {
*ppFind = pNames;
}
csName = pNames->GetString((nIndex - nCurIndex) * 2);
@@ -389,7 +389,6 @@ CPDF_Stream* CPDF_FileSpec::GetFileStream() const {
static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object* pObj,
const CFX_WideStringC& wsFileName,
FX_BOOL bURL) {
- ASSERT(pObj != NULL);
CFX_WideString wsStr;
if (bURL) {
wsStr = wsFileName;
@@ -405,7 +404,6 @@ static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object* pObj,
}
void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName,
FX_BOOL bURL) {
- ASSERT(m_pObj != NULL);
if (bURL) {
if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) {
pDict->SetAtName("FS", "URL");
@@ -483,12 +481,12 @@ CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const {
int n = nPage;
while (n >= 0) {
pValue = numberTree.LookupValue(n);
- if (pValue != NULL) {
+ if (pValue) {
break;
}
n--;
}
- if (pValue != NULL) {
+ if (pValue) {
pValue = pValue->GetDirect();
if (CPDF_Dictionary* pLabel = pValue->AsDictionary()) {
if (pLabel->KeyExist("P")) {