Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: fpdfsdk/cpdfsdk_xfawidgethandler.cpp

Issue 2400673002: Convert CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_widgethandler.cpp ('k') | fpdfsdk/formfiller/cffl_interactiveformfiller.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_xfawidgethandler.cpp
diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp
index 17d80cc544c48961ab35ddd30ba7a1dfed830b36..b936bc4c66312ae147c14b3bbd00a1b1c7659923 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;
« no previous file with comments | « fpdfsdk/cpdfsdk_widgethandler.cpp ('k') | fpdfsdk/formfiller/cffl_interactiveformfiller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698