From 3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 2 Nov 2016 14:51:25 -0700 Subject: Merge delegates into IFWL_* classes. This Cl removes ownership of the delgates from IFWL_Widget and puts it in the hand of the creating classes. In doing so, merge the delegates back into the IFWL_* classes to simplify logic. Review-Url: https://codereview.chromium.org/2467993003 --- xfa/fwl/core/ifwl_barcode.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'xfa/fwl/core/ifwl_barcode.cpp') diff --git a/xfa/fwl/core/ifwl_barcode.cpp b/xfa/fwl/core/ifwl_barcode.cpp index 9a2d91a459..e708e7ed53 100644 --- a/xfa/fwl/core/ifwl_barcode.cpp +++ b/xfa/fwl/core/ifwl_barcode.cpp @@ -16,7 +16,6 @@ IFWL_Barcode::IFWL_Barcode(const IFWL_App* app, const CFWL_WidgetImpProperties& properties) : IFWL_Edit(app, properties, nullptr), m_dwStatus(0), m_type(BC_UNKNOWN) { - SetDelegate(pdfium::MakeUnique(this)); } IFWL_Barcode::~IFWL_Barcode() {} @@ -175,14 +174,10 @@ FX_BOOL IFWL_Barcode::IsProtectedType() { return FALSE; } -CFWL_BarcodeImpDelegate::CFWL_BarcodeImpDelegate(IFWL_Barcode* pOwner) - : CFWL_EditImpDelegate(pOwner) {} - -void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { +void IFWL_Barcode::OnProcessEvent(CFWL_Event* pEvent) { if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { - IFWL_Barcode* pOwner = static_cast(m_pOwner); - pOwner->m_pBarcodeEngine.reset(); - pOwner->m_dwStatus = XFA_BCS_NeedUpdate; + m_pBarcodeEngine.reset(); + m_dwStatus = XFA_BCS_NeedUpdate; } - CFWL_EditImpDelegate::OnProcessEvent(pEvent); + IFWL_Edit::OnProcessEvent(pEvent); } -- cgit v1.2.3