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/formfiller/cffl_interactiveformfiller.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'fpdfsdk/formfiller') diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 12c55d37b3..c62de9bfb5 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -691,8 +691,8 @@ void CFFL_InteractiveFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, uint32_t nFlag) { if (!m_bNotifying) { ASSERT(pWidget); - CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); + CPDFSDK_InterForm* pInterForm = + pPageView->GetFormFillEnv()->GetSDKDocument()->GetInterForm(); pInterForm->OnCalculate(pWidget->GetFormField()); m_bNotifying = FALSE; } @@ -704,8 +704,8 @@ void CFFL_InteractiveFormFiller::OnFormat(CPDFSDK_Widget* pWidget, uint32_t nFlag) { if (!m_bNotifying) { ASSERT(pWidget); - CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); + CPDFSDK_InterForm* pInterForm = + pPageView->GetFormFillEnv()->GetSDKDocument()->GetInterForm(); FX_BOOL bFormatted = FALSE; CFX_WideString sValue = @@ -932,7 +932,8 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke( int nAge = pData->pWidget->GetAppearanceAge(); int nValueAge = pData->pWidget->GetValueAge(); - CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); + CPDFSDK_FormFillEnvironment* pFormFillEnv = + pData->pPageView->GetFormFillEnv(); PDFSDK_FieldAction fa; fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); @@ -973,7 +974,7 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke( bRC = FALSE; } - if (pDocument->GetFocusAnnot() != pData->pWidget) { + if (pFormFillEnv->GetSDKDocument()->GetFocusAnnot() != pData->pWidget) { pFormFiller->CommitData(pData->pPageView, nFlag); bExit = TRUE; } -- cgit v1.2.3