diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-11 09:26:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-11 09:26:32 -0700 |
commit | b402b1738d665561dd1bb7ffba0c3f3d49425086 (patch) | |
tree | b7542f810c1d9199179dc60e5cdd43a5c794b880 /fpdfsdk/cpdfsdk_xfawidgethandler.cpp | |
parent | 690c033e86b34f7a9c3d4be15759c63ef9360217 (diff) | |
download | pdfium-b402b1738d665561dd1bb7ffba0c3f3d49425086.tar.xz |
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
Diffstat (limited to 'fpdfsdk/cpdfsdk_xfawidgethandler.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
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; |