From 1e2c557e0fa0e47c8bafdb31c833ea4f90f5fedd Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 25 May 2016 14:58:09 -0700 Subject: Remove CFX_PrivateData from CPDF_Page CFX_PrivateData served two purposes here: The first was to hold an opaque pointer to the corresponding page structure in the next higher layer, of which it knows no details. Introduce an empty CPDF_Page::View class to represent this higher class, so as to get type safety while preserving layering. The second was to hold an opaque render context, which it also happened to own. Make this a CFX_Deletable to help with management. Also remove an unused inheritance from CFX_PrivateData in CPDF_Annot. Review-Url: https://codereview.chromium.org/2008553008 --- fpdfsdk/fsdk_mgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fsdk_mgr.cpp') diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp index fac98d8aa3..83fee907d2 100644 --- a/fpdfsdk/fsdk_mgr.cpp +++ b/fpdfsdk/fsdk_mgr.cpp @@ -480,7 +480,7 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, #endif // PDF_ENABLE_XFA } #ifndef PDF_ENABLE_XFA - m_page->SetPrivateData((void*)m_page, (void*)this, nullptr); + m_page->SetView(this); #endif // PDF_ENABLE_XFA } @@ -493,7 +493,7 @@ CPDFSDK_PageView::~CPDFSDK_PageView() { m_fxAnnotArray.clear(); m_pAnnotList.reset(); #ifndef PDF_ENABLE_XFA - m_page->RemovePrivateData((void*)m_page); + m_page->SetView(nullptr); if (m_bTakeOverPage) { delete m_page; } -- cgit v1.2.3