From 7b0ff3c93dfb4925da5495794fde0fff1a68c9d1 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 4 Oct 2018 22:19:32 +0000 Subject: Remove null m_page checks from CPDFSDK_PageView. The constructor asserts that it isn't null. Change-Id: I1812068916e8a55693387077ba3faac539172534 Reviewed-on: https://pdfium-review.googlesource.com/c/43510 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/cpdfsdk_pageview.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index def911d4ae..0713d29a5f 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -191,7 +191,7 @@ bool CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { #endif // PDF_ENABLE_XFA CPDF_Document* CPDFSDK_PageView::GetPDFDocument() { - return m_page ? m_page->GetDocument() : nullptr; + return m_page->GetDocument(); } CPDF_Page* CPDFSDK_PageView::GetPDFPage() const { @@ -504,9 +504,6 @@ void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { } int CPDFSDK_PageView::GetPageIndex() const { - if (!m_page) - return -1; - #ifdef PDF_ENABLE_XFA auto* pContext = static_cast( m_page->AsXFAPage()->GetDocumentExtension()); -- cgit v1.2.3