summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_utils.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
commit96660d6f382204339d6b1aadc3913303d436e252 (patch)
treeb5f84756e1a89251831cebc05b9d4e1f6cb2027b /core/src/fpdfdoc/doc_utils.cpp
parentd983b09c3ae29a97cba8e9ec9c6351545f6087ee (diff)
downloadpdfium-96660d6f382204339d6b1aadc3913303d436e252.tar.xz
Merge to XFA: Get rid of most instance of 'foo != NULL'
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
Diffstat (limited to 'core/src/fpdfdoc/doc_utils.cpp')
-rw-r--r--core/src/fpdfdoc/doc_utils.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp
index adf523f74e..f26355fae5 100644
--- a/core/src/fpdfdoc/doc_utils.cpp
+++ b/core/src/fpdfdoc/doc_utils.cpp
@@ -242,7 +242,7 @@ void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) {
CFX_ByteString csBaseName, csDefault;
uint8_t charSet = CPDF_InterForm::GetNativeCharSet();
pFont = CPDF_InterForm::AddStandardFont(pDocument, "Helvetica");
- if (pFont != NULL) {
+ if (pFont) {
AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
csDefault = csBaseName;
}
@@ -250,14 +250,14 @@ void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) {
CFX_ByteString csFontName = CPDF_InterForm::GetNativeFont(charSet, NULL);
if (pFont == NULL || csFontName != "Helvetica") {
pFont = CPDF_InterForm::AddNativeFont(pDocument);
- if (pFont != NULL) {
+ if (pFont) {
csBaseName = "";
AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
csDefault = csBaseName;
}
}
}
- if (pFont != NULL) {
+ if (pFont) {
csDA = "/" + PDF_NameEncode(csDefault) + " 0 Tf";
}
}
@@ -452,9 +452,9 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
uint8_t charSet = CPDF_InterForm::GetNativeCharSet();
CFX_SubstFont* pSubst;
CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
- if (pFont != NULL) {
+ if (pFont) {
pSubst = (CFX_SubstFont*)pFont->GetSubstFont();
- if (pSubst != NULL && pSubst->m_Charset == (int)charSet) {
+ if (pSubst && pSubst->m_Charset == (int)charSet) {
FindInterFormFont(pFormDict, pFont, csNameTag);
return pFont;
}
@@ -592,7 +592,7 @@ CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict,
CFX_ByteString csTemp;
CPDF_Font* pFont =
GetNativeInterFormFont(pFormDict, pDocument, charSet, csTemp);
- if (pFont != NULL) {
+ if (pFont) {
csNameTag = csTemp;
return pFont;
}
@@ -603,7 +603,7 @@ CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict,
}
}
pFont = CPDF_InterForm::AddNativeFont(charSet, pDocument);
- if (pFont != NULL) {
+ if (pFont) {
AddInterFormFont(pFormDict, pDocument, pFont, csNameTag);
}
return pFont;
@@ -679,7 +679,7 @@ void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
return;
}
CPDF_Array* pA = m_pDict->GetArray("A");
- if (pA != NULL) {
+ if (pA) {
FX_DWORD dwCount = pA->GetCount();
if (dwCount > 0) {
fLeft = pA->GetNumber(0);