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 <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index def911d..0713d29 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -191,7 +191,7 @@
#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 @@
}
int CPDFSDK_PageView::GetPageIndex() const {
- if (!m_page)
- return -1;
-
#ifdef PDF_ENABLE_XFA
auto* pContext = static_cast<CPDFXFA_Context*>(
m_page->AsXFAPage()->GetDocumentExtension());