Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1793)

Unified Diff: core/src/fpdfdoc/doc_action.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfdoc/doc_action.cpp
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp
index 3ad746067d43351451f4efce282e4d4902ab74b0..55e3a8a484f47a48e60b79b6cab0ad83e7d7652b 100644
--- a/core/src/fpdfdoc/doc_action.cpp
+++ b/core/src/fpdfdoc/doc_action.cpp
@@ -34,7 +34,7 @@ const FX_CHAR* g_sATypes[] = {
"SetOCGState", "Rendition", "Trans", "GoTo3DView", ""};
CPDF_Action::ActionType CPDF_Action::GetType() const {
ActionType eType = Unknown;
- if (m_pDict != NULL) {
+ if (m_pDict) {
CFX_ByteString csType = m_pDict->GetString("S");
if (!csType.IsEmpty()) {
int i = 0;
@@ -80,7 +80,7 @@ CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const {
csURI = m_pDict->GetString("URI");
CPDF_Dictionary* pRoot = pDoc->GetRoot();
CPDF_Dictionary* pURI = pRoot->GetDict("URI");
- if (pURI != NULL) {
+ if (pURI) {
if (csURI.Find(":", 0) < 1) {
csURI = pURI->GetString("Base") + csURI;
}
@@ -179,7 +179,7 @@ CFX_WideString CPDF_Action::GetJavaScript() const {
return csJS;
}
CPDF_Object* pJS = m_pDict->GetElementValue("JS");
- if (pJS != NULL) {
+ if (pJS) {
Tom Sepez 2015/12/14 19:14:08 nit: use ? oper.
Lei Zhang 2015/12/15 01:38:32 Done.
return pJS->GetUnicodeText();
}
return csJS;
@@ -298,13 +298,13 @@ CPDF_Action CPDF_AAction::GetNextAction(FX_POSITION& pos,
CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
int CPDF_DocJSActions::CountJSActions() const {
- ASSERT(m_pDocument != NULL);
+ ASSERT(m_pDocument);
CPDF_NameTree name_tree(m_pDocument, "JavaScript");
return name_tree.GetCount();
}
CPDF_Action CPDF_DocJSActions::GetJSAction(int index,
CFX_ByteString& csName) const {
- ASSERT(m_pDocument != NULL);
+ ASSERT(m_pDocument);
CPDF_NameTree name_tree(m_pDocument, "JavaScript");
CPDF_Object* pAction = name_tree.LookupValue(index, csName);
if (!ToDictionary(pAction)) {
@@ -313,7 +313,7 @@ CPDF_Action CPDF_DocJSActions::GetJSAction(int index,
return CPDF_Action(pAction->GetDict());
}
CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const {
- ASSERT(m_pDocument != NULL);
+ ASSERT(m_pDocument);
CPDF_NameTree name_tree(m_pDocument, "JavaScript");
CPDF_Object* pAction = name_tree.LookupValue(csName);
if (!ToDictionary(pAction)) {
@@ -322,7 +322,7 @@ CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const {
return CPDF_Action(pAction->GetDict());
}
int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const {
- ASSERT(m_pDocument != NULL);
+ ASSERT(m_pDocument);
CPDF_NameTree name_tree(m_pDocument, "JavaScript");
return name_tree.GetIndex(csName);
}

Powered by Google App Engine
This is Rietveld 408576698