diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:29:28 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:29:28 -0800 |
commit | e385244f8cd6ae376f6b3cf1265a0795d5d30eff (patch) | |
tree | 4bdd7c459f167ee56ae35f3b87222c2557f501f8 /core/src/fpdfdoc/doc_ap.cpp | |
parent | e3c7c2b54348da4a6939f6672f6c6bff126815a7 (diff) | |
download | pdfium-e385244f8cd6ae376f6b3cf1265a0795d5d30eff.tar.xz |
Get rid of most instance of 'foo == NULL'
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
Diffstat (limited to 'core/src/fpdfdoc/doc_ap.cpp')
-rw-r--r-- | core/src/fpdfdoc/doc_ap.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index 1392ae6e2e..0efaa8caa5 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -292,7 +292,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, FX_BOOL bUseFormRes = FALSE; CPDF_Dictionary* pFontDict = NULL; CPDF_Dictionary* pDRDict = pAnnotDict->GetDict("DR"); - if (pDRDict == NULL) { + if (!pDRDict) { pDRDict = pFormDict->GetDict("DR"); bUseFormRes = TRUE; } @@ -312,7 +312,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } if (!pFontDict) { pFontDict = CPDF_Dictionary::Create(); - if (pFontDict == NULL) { + if (!pFontDict) { return FALSE; } pFontDict->SetAtName("Type", "Font"); @@ -418,11 +418,8 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, rcBBox.right - fBorderWidth, rcBBox.top - fBorderWidth); rcBody.Normalize(); CPDF_Dictionary* pAPDict = pAnnotDict->GetDict("AP"); - if (pAPDict == NULL) { + if (!pAPDict) { pAPDict = CPDF_Dictionary::Create(); - if (pAPDict == NULL) { - return FALSE; - } pAnnotDict->SetAt("AP", pAPDict); } CPDF_Stream* pNormalStream = pAPDict->GetStream("N"); @@ -440,7 +437,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font"); if (!pStreamResFontList) { pStreamResFontList = CPDF_Dictionary::Create(); - if (pStreamResFontList == NULL) { + if (!pStreamResFontList) { return FALSE; } pStreamResList->SetAt("Font", pStreamResFontList); @@ -688,7 +685,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font"); if (!pStreamResFontList) { pStreamResFontList = CPDF_Dictionary::Create(); - if (pStreamResFontList == NULL) { + if (!pStreamResFontList) { return FALSE; } pStreamResList->SetAt("Font", pStreamResFontList); |