From a3843c99e7a631b2fbf87bbc12834e61bfb7b6f2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 12 Jun 2018 19:21:46 +0000 Subject: Remove some #ifdef XFA in favor of runtime checks. Make LoadDocumentImpl() logic match FPDFAvail_GetDocument() logic, so that the XFA extension is loaded before checking unsupported features. Add some comments along the way. Change-Id: I040e40fcca872f7c0a46e921bce1146f0fe42588 Reviewed-on: https://pdfium-review.googlesource.com/34931 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- fpdfsdk/cpdfsdk_pageview.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/cpdfsdk_pageview.h') diff --git a/fpdfsdk/cpdfsdk_pageview.h b/fpdfsdk/cpdfsdk_pageview.h index 38ff288607..46c35e1e2d 100644 --- a/fpdfsdk/cpdfsdk_pageview.h +++ b/fpdfsdk/cpdfsdk_pageview.h @@ -44,7 +44,6 @@ class CPDFSDK_PageView final : public CPDF_Page::View { bool DeleteAnnot(CPDFSDK_Annot* pAnnot); CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); - CPDFXFA_Page* GetPDFXFAPage() { return ToXFAPage(m_page); } #endif // PDF_ENABLE_XFA @@ -66,10 +65,12 @@ class CPDFSDK_PageView final : public CPDF_Page::View { bool OnFocus(const CFX_PointF& point, uint32_t nFlag); bool OnLButtonDown(const CFX_PointF& point, uint32_t nFlag); bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag); + #ifdef PDF_ENABLE_XFA bool OnRButtonDown(const CFX_PointF& point, uint32_t nFlag); bool OnRButtonUp(const CFX_PointF& point, uint32_t nFlag); #endif // PDF_ENABLE_XFA + bool OnChar(int nChar, uint32_t nFlag); bool OnKeyDown(int nKeyCode, int nFlag); bool OnKeyUp(int nKeyCode, int nFlag); @@ -88,15 +89,10 @@ class CPDFSDK_PageView final : public CPDF_Page::View { void SetValid(bool bValid) { m_bValid = bValid; } bool IsValid() { return m_bValid; } - bool IsLocked() { return m_bLocked; } - 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); @@ -117,9 +113,7 @@ 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; -- cgit v1.2.3