summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-04 22:19:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-04 22:19:32 +0000
commit7b0ff3c93dfb4925da5495794fde0fff1a68c9d1 (patch)
treee40dd2103ef0a59305913548ff3814a552853259
parentb8768b7ca3379d0cd25fddf87799458e39ac5477 (diff)
downloadpdfium-7b0ff3c93dfb4925da5495794fde0fff1a68c9d1.tar.xz
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>
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp5
1 files changed, 1 insertions, 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<CPDFXFA_Context*>(
m_page->AsXFAPage()->GetDocumentExtension());