diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-02 14:51:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-02 14:51:25 -0700 |
commit | 3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 (patch) | |
tree | 365d9ee7f8eec1103fb9fce0986e23d9f548ecae /xfa/fwl/core/ifwl_barcode.cpp | |
parent | 4cf551577856f89103e162edc761def44ffb96fc (diff) | |
download | pdfium-3b3ce1a242f8445848d3f23d6c35ba01d7c645f4.tar.xz |
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
Diffstat (limited to 'xfa/fwl/core/ifwl_barcode.cpp')
-rw-r--r-- | xfa/fwl/core/ifwl_barcode.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
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<CFWL_BarcodeImpDelegate>(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<IFWL_Barcode*>(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); } |