Remove CPDFXFA_Widget::m_pInteractiveForm Although set, is is never again used, and the unowned reference does not alter its lifetime. In turn, this makes CPDFXFA_WidgetHandler::m_pFormFillEnv unused for the same reasons. Change-Id: I361977921d83baa5d14427fcede1481ce81df01a Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/84790 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp index 8f54fbb..386dcba 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp
@@ -10,11 +10,8 @@ #include "xfa/fxfa/cxfa_ffwidget.h" CPDFXFA_Widget::CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget, - CPDFSDK_PageView* pPageView, - CPDFSDK_InteractiveForm* pInteractiveForm) - : CPDFSDK_Annot(pPageView), - m_pInteractiveForm(pInteractiveForm), - m_pXFAFFWidget(pXFAFFWidget) {} + CPDFSDK_PageView* pPageView) + : CPDFSDK_Annot(pPageView), m_pXFAFFWidget(pXFAFFWidget) {} CPDFXFA_Widget::~CPDFXFA_Widget() = default;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widget.h b/fpdfsdk/fpdfxfa/cpdfxfa_widget.h index a3d35f7..dd11990 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_widget.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_widget.h
@@ -8,19 +8,15 @@ #define FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_ #include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/unowned_ptr.h" #include "fpdfsdk/cpdfsdk_annot.h" #include "v8/include/cppgc/persistent.h" #include "xfa/fxfa/cxfa_ffwidget.h" -class CPDFSDK_InteractiveForm; class CPDFSDK_PageView; class CPDFXFA_Widget final : public CPDFSDK_Annot { public: - CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget, - CPDFSDK_PageView* pPageView, - CPDFSDK_InteractiveForm* pInteractiveForm); + CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget, CPDFSDK_PageView* pPageView); ~CPDFXFA_Widget() override; // CPDFSDK_Annot: @@ -29,12 +25,8 @@ CFX_FloatRect GetRect() const override; CXFA_FFWidget* GetXFAFFWidget() const { return m_pXFAFFWidget.Get(); } - CPDFSDK_InteractiveForm* GetInteractiveForm() const { - return m_pInteractiveForm.Get(); - } private: - UnownedPtr<CPDFSDK_InteractiveForm> const m_pInteractiveForm; cppgc::Persistent<CXFA_FFWidget> const m_pXFAFFWidget; };
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp index 8ff7552..7350cb7 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
@@ -205,9 +205,7 @@ CPDFXFA_WidgetHandler::~CPDFXFA_WidgetHandler() = default; void CPDFXFA_WidgetHandler::SetFormFillEnvironment( - CPDFSDK_FormFillEnvironment* pFormFillEnv) { - m_pFormFillEnv = pFormFillEnv; -} + CPDFSDK_FormFillEnvironment* pFormFillEnv) {} bool CPDFXFA_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { CPDFXFA_Widget* pWidget = ToXFAWidget(pAnnot); @@ -223,8 +221,7 @@ std::unique_ptr<CPDFSDK_Annot> CPDFXFA_WidgetHandler::NewAnnotForXFA( CXFA_FFWidget* pAnnot, CPDFSDK_PageView* pPageView) { - CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm(); - return std::make_unique<CPDFXFA_Widget>(pAnnot, pPageView, pForm); + return std::make_unique<CPDFXFA_Widget>(pAnnot, pPageView); } void CPDFXFA_WidgetHandler::OnDraw(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.h b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.h index 2794533..4f42554 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.h
@@ -10,7 +10,6 @@ #include <memory> #include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/unowned_ptr.h" #include "fpdfsdk/ipdfsdk_annothandler.h" #include "public/fpdf_fwlevent.h" #include "xfa/fwl/cfwl_messagemouse.h" @@ -120,8 +119,6 @@ private: CXFA_FFWidgetHandler* GetXFAFFWidgetHandler(CPDFSDK_Annot* pAnnot); Mask<XFA_FWL_KeyFlag> GetKeyFlags(Mask<FWL_EVENTFLAG> dwFlag); - - UnownedPtr<CPDFSDK_FormFillEnvironment> m_pFormFillEnv; }; #endif // FPDFSDK_FPDFXFA_CPDFXFA_WIDGETHANDLER_H_