Index: fpdfsdk/cpdfsdk_widgethandler.cpp |
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp |
index 8bae1494481f6e9fe108cd3594cd8fd4f596d557..056b0bb2c2588916add78a9b3ede5e202a6e27a7 100644 |
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp |
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp |
@@ -24,8 +24,9 @@ |
#include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" |
#endif // PDF_ENABLE_XFA |
-CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler(CPDFSDK_FormFillEnvironment* pEnv) |
- : m_pEnv(pEnv), m_pFormFiller(nullptr) {} |
+CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler( |
+ CPDFSDK_FormFillEnvironment* pFormFillEnv) |
+ : m_pFormFillEnv(pFormFillEnv), m_pFormFiller(nullptr) {} |
CPDFSDK_WidgetHandler::~CPDFSDK_WidgetHandler() {} |
@@ -54,8 +55,7 @@ FX_BOOL CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { |
CPDFSDK_Annot* CPDFSDK_WidgetHandler::NewAnnot(CPDF_Annot* pAnnot, |
CPDFSDK_PageView* pPage) { |
- CPDFSDK_Document* pSDKDoc = m_pEnv->GetSDKDocument(); |
- CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm(); |
CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl( |
pInterForm->GetInterForm(), pAnnot->GetAnnotDict()); |
if (!pCtrl) |
@@ -251,8 +251,7 @@ void CPDFSDK_WidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) { |
#ifdef PDF_ENABLE_XFA |
CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
- CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); |
- CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); |
+ CPDFXFA_Document* pDoc = pPageView->GetFormFillEnv()->GetXFADocument(); |
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { |
if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) |
pWidget->ResetAppearance(FALSE); |