From 2491990f50f8ea48a509eb0ccc0193b4c1a3f776 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 4 Jun 2018 17:47:28 +0000 Subject: Revert "Make pagview decisions at runtime for non-xfa pages." This reverts commit d8126c2e72a60403c73f4187d4041364d45a8d61. Reason for revert: Blocking previous revert. Change-Id: I144841ad257401ab626b981ef7691d3b8003a49a Reviewed-on: https://pdfium-review.googlesource.com/33711 Reviewed-by: Tom Sepez Commit-Queue: Tom Sepez --- fpdfsdk/cpdfsdk_pageview.h | 5 +++++ fpdfsdk/fpdf_view.cpp | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fpdfsdk/cpdfsdk_pageview.h b/fpdfsdk/cpdfsdk_pageview.h index 1df29b9ec4..cf2d9bf442 100644 --- a/fpdfsdk/cpdfsdk_pageview.h +++ b/fpdfsdk/cpdfsdk_pageview.h @@ -92,7 +92,10 @@ class CPDFSDK_PageView final : public CPDF_Page::View { void SetBeingDestroyed() { m_bBeingDestroyed = true; } bool IsBeingDestroyed() const { return m_bBeingDestroyed; } + +#ifndef PDF_ENABLE_XFA void TakePageOwnership() { m_pOwnsPage.Reset(ToPDFPage(m_page)); } +#endif // PDF_ENABLE_XFA private: CPDFSDK_Annot* GetFXAnnotAtPoint(const CFX_PointF& point); @@ -113,7 +116,9 @@ class CPDFSDK_PageView final : public CPDF_Page::View { std::vector m_SDKAnnotArray; UnownedPtr const m_pFormFillEnv; CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; +#ifndef PDF_ENABLE_XFA RetainPtr m_pOwnsPage; +#endif // PDF_ENABLE_XFA bool m_bOnWidget = false; bool m_bValid = false; bool m_bLocked = false; diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp index f0ceb1f378..d5c2a7e3dd 100644 --- a/fpdfsdk/fpdf_view.cpp +++ b/fpdfsdk/fpdf_view.cpp @@ -734,9 +734,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page) { RetainPtr pPage; pPage.Unleak(IPDFPageFromFPDFPage(page)); - if (pPage->AsXFAPage()) - return; - +#ifndef PDF_ENABLE_XFA CPDFSDK_PageView* pPageView = static_cast(pPage->AsPDFPage()->GetView()); if (!pPageView || pPageView->IsBeingDestroyed()) @@ -751,6 +749,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page) { // first because it will attempt to reset the View on the |pPage| during // destruction. pPageView->GetFormFillEnv()->RemovePageView(pPage.Get()); +#endif // PDF_ENABLE_XFA } FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document) { -- cgit v1.2.3