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/fpdfdoc/doc_ap.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/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); |