diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-05-30 18:11:51 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-30 18:11:51 +0000 |
commit | d06cc38b76685b002c51b227ae43b8314d926ad8 (patch) | |
tree | 89413c48e3de57f3e09043310598eaf219b78bca /fpdfsdk/cpdfsdk_pageview.h | |
parent | 0789714191b4b3109f7d5c415663090018e27577 (diff) | |
download | pdfium-d06cc38b76685b002c51b227ae43b8314d926ad8.tar.xz |
Make common page base class for XFA and non-XFA.
Now that both are ref-counted, we can replace ifdef's with some
polymorphism.
Bug: pdfium:760
Change-Id: Ie22ea259c9af56fa569f0af268b8e7065789a3f2
Reviewed-on: https://pdfium-review.googlesource.com/32892
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_pageview.h')
-rw-r--r-- | fpdfsdk/cpdfsdk_pageview.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.h b/fpdfsdk/cpdfsdk_pageview.h index bfb6450ca8..cf2d9bf442 100644 --- a/fpdfsdk/cpdfsdk_pageview.h +++ b/fpdfsdk/cpdfsdk_pageview.h @@ -22,8 +22,7 @@ class CPDF_RenderOptions; class CPDFSDK_PageView final : public CPDF_Page::View { public: - CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv, - UnderlyingPageType* page); + CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv, IPDF_Page* page); ~CPDFSDK_PageView(); void PageView_OnDraw(CFX_RenderDevice* pDevice, @@ -45,8 +44,7 @@ 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 m_page; } + CPDFXFA_Page* GetPDFXFAPage() { return ToXFAPage(m_page); } #endif // PDF_ENABLE_XFA CPDF_Page* GetPDFPage() const; @@ -96,7 +94,7 @@ class CPDFSDK_PageView final : public CPDF_Page::View { bool IsBeingDestroyed() const { return m_bBeingDestroyed; } #ifndef PDF_ENABLE_XFA - void TakePageOwnership() { m_pOwnsPage.Reset(m_page); } + void TakePageOwnership() { m_pOwnsPage.Reset(ToPDFPage(m_page)); } #endif // PDF_ENABLE_XFA private: @@ -113,7 +111,7 @@ class CPDFSDK_PageView final : public CPDF_Page::View { uint32_t nFlag); CFX_Matrix m_curMatrix; - UnderlyingPageType* const m_page; + IPDF_Page* const m_page; std::unique_ptr<CPDF_AnnotList> m_pAnnotList; std::vector<CPDFSDK_Annot*> m_SDKAnnotArray; UnownedPtr<CPDFSDK_FormFillEnvironment> const m_pFormFillEnv; |