summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_pageview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-04 17:12:27 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-04 17:12:27 +0000
commit28d30b4870fb5327937fa0541d0059fc439736aa (patch)
treebb9ad2321d3b0f5ff9e5d2481e4520055ff94832 /fpdfsdk/cpdfsdk_pageview.cpp
parent037d938a172dda98b25a6e8bdfc4a83d6991fbed (diff)
downloadpdfium-28d30b4870fb5327937fa0541d0059fc439736aa.tar.xz
Revert "Remove more ifndef XFA cases"
This reverts commit 38cb7263a0923dd5613da24b18d3d7ef052ff5e3. Reason for revert: Blocking prior revert. Original change's description: > Remove more ifndef XFA cases > > Remove FXFT_Clear_Face_External_Stream() calls, period. This would cause > FT to try to free memory allocated by the caller, with potentially a > different allocator. If we're leaking, msan will find it, and we can > deal with it properly rather than trying to force FT to tidy after us. > > Always call SetView(), if we have a PDF page. At worst, the link won't > be used in the XFA case. > > Always return 0 for the null document permissions. If we don't have a > document, then we can't dynamically tell if its an XFA doc, so there's > no reason to believe it should have all permissions. If there is an > XFA doc under the covers, then the extension will give us the value. > > > Change-Id: I6e3fb589eda722786567d96288cb35f43643437b > Reviewed-on: https://pdfium-review.googlesource.com/33370 > Commit-Queue: Tom Sepez <tsepez@chromium.org> > Reviewed-by: Lei Zhang <thestig@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I68b6a50ef28fb3d6ab9d8494c4486ca9fb66589e Reviewed-on: https://pdfium-review.googlesource.com/33734 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_pageview.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 06d197dfba..5cb5f2ced2 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -38,18 +38,19 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
pPDFInterForm->FixPageFields(pPDFPage);
+#ifndef PDF_ENABLE_XFA
pPDFPage->SetView(this);
+#endif // PDF_ENABLE_XFA
}
}
CPDFSDK_PageView::~CPDFSDK_PageView() {
- CPDF_Page* pPDFPage = ToPDFPage(m_page);
- if (pPDFPage) {
- // The call to |ReleaseAnnot| can cause the page pointed to by |m_page| to
- // be freed, which will cause issues if we try to cleanup the pageview ptr
- // in |m_page|. So, reset the pageview pointer before doing anything else.
- pPDFPage->SetView(nullptr);
- }
+#ifndef PDF_ENABLE_XFA
+ // The call to |ReleaseAnnot| can cause the page pointed to by |m_page| to
+ // be freed, which will cause issues if we try to cleanup the pageview pointer
+ // in |m_page|. So, reset the pageview pointer before doing anything else.
+ m_page->AsPDFPage()->SetView(nullptr);
+#endif // PDF_ENABLE_XFA
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr =
m_pFormFillEnv->GetAnnotHandlerMgr();