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/fpdfapi/fpdf_page/fpdf_page.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/fpdfapi/fpdf_page/fpdf_page.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index f37dd770ca..1fef74b99b 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -689,7 +689,7 @@ CPDF_PageObjects::~CPDF_PageObjects() { } } void CPDF_PageObjects::ContinueParse(IFX_Pause* pPause) { - if (m_pParser == NULL) { + if (!m_pParser) { return; } m_pParser->Continue(pPause); @@ -720,10 +720,7 @@ int CPDF_PageObjects::GetObjectIndex(CPDF_PageObject* pObj) const { } CPDF_PageObject* CPDF_PageObjects::GetObjectByIndex(int index) const { FX_POSITION pos = m_ObjectList.FindIndex(index); - if (pos == NULL) { - return NULL; - } - return (CPDF_PageObject*)m_ObjectList.GetAt(pos); + return pos ? static_cast<CPDF_PageObject*>(m_ObjectList.GetAt(pos)) : nullptr; } void CPDF_PageObjects::Transform(const CFX_Matrix& matrix) { FX_POSITION pos = m_ObjectList.GetHeadPosition(); @@ -758,11 +755,11 @@ CFX_FloatRect CPDF_PageObjects::CalcBoundingBox() const { return CFX_FloatRect(left, bottom, right, top); } void CPDF_PageObjects::LoadTransInfo() { - if (m_pFormDict == NULL) { + if (!m_pFormDict) { return; } CPDF_Dictionary* pGroup = m_pFormDict->GetDict("Group"); - if (pGroup == NULL) { + if (!pGroup) { return; } if (pGroup->GetString("S") != "Transparency") { @@ -800,7 +797,7 @@ void CPDF_Page::Load(CPDF_Document* pDocument, m_pPageRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreatePageCache(this); } - if (pPageDict == NULL) { + if (!pPageDict) { m_PageWidth = m_PageHeight = 100 * 1.0f; m_pPageResources = m_pResources = NULL; return; @@ -912,10 +909,10 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc, m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL; m_pResources = m_pFormDict->GetDict("Resources"); m_pPageResources = pPageResources; - if (m_pResources == NULL) { + if (!m_pResources) { m_pResources = pParentResources; } - if (m_pResources == NULL) { + if (!m_pResources) { m_pResources = pPageResources; } m_Transparency = 0; |