From b402b1738d665561dd1bb7ffba0c3f3d49425086 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 11 Oct 2016 09:26:32 -0700 Subject: Convert CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment This CL changes CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment instead of a CPDFSDK_Document. Review-Url: https://codereview.chromium.org/2400673002 --- fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/cpdfsdk_xfawidgethandler.cpp') diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index 17d80cc544..b936bc4c66 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -54,9 +54,6 @@ void CPDFSDK_XFAWidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, ASSERT(pPageView); ASSERT(pAnnot); - CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); - CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); - CFX_Graphics gs; gs.Create(pDevice); @@ -64,10 +61,11 @@ void CPDFSDK_XFAWidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, mt = *pUser2Device; FX_BOOL bIsHighlight = FALSE; - if (pSDKDoc->GetFocusAnnot() != pAnnot) + if (pPageView->GetFormFillEnv()->GetSDKDocument()->GetFocusAnnot() != pAnnot) bIsHighlight = TRUE; - pWidgetHandler->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, bIsHighlight); + GetXFAWidgetHandler(pAnnot)->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, + bIsHighlight); // to do highlight and shadow } @@ -117,11 +115,11 @@ FX_BOOL CPDFSDK_XFAWidgetHandler::HitTest(CPDFSDK_PageView* pPageView, if (!pPageView || !pAnnot) return FALSE; - CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); - if (!pSDKDoc) + CPDFSDK_FormFillEnvironment* pFormFillEnv = pPageView->GetFormFillEnv(); + if (!pFormFillEnv->GetSDKDocument()) return FALSE; - CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); + CPDFXFA_Document* pDoc = pFormFillEnv->GetSDKDocument()->GetXFADocument(); if (!pDoc) return FALSE; @@ -346,11 +344,11 @@ CXFA_FFWidgetHandler* CPDFSDK_XFAWidgetHandler::GetXFAWidgetHandler( if (!pPageView) return nullptr; - CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); - if (!pSDKDoc) + CPDFSDK_FormFillEnvironment* pFormFillEnv = pPageView->GetFormFillEnv(); + if (!pFormFillEnv->GetSDKDocument()) return nullptr; - CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); + CPDFXFA_Document* pDoc = pFormFillEnv->GetSDKDocument()->GetXFADocument(); if (!pDoc) return nullptr; -- cgit v1.2.3