From 28f9b62c397c4f3f8dc0cba69ce1cb8c02f81e76 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 17 Nov 2016 09:55:41 -0800 Subject: Remove the CFWL_EventType::DrawItem The ListBox DrawItems event is caught by the ComboBox which converts the event into a ComboBox DrawItems event which is never processed. Removed both. Review-Url: https://codereview.chromium.org/2510123002 --- xfa/fwl/core/cfwl_event.h | 1 - xfa/fwl/core/ifwl_combobox.cpp | 11 +---------- xfa/fwl/core/ifwl_combobox.h | 7 ------- xfa/fwl/core/ifwl_listbox.cpp | 11 +---------- xfa/fwl/core/ifwl_listbox.h | 7 ------- 5 files changed, 2 insertions(+), 35 deletions(-) (limited to 'xfa/fwl/core') diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h index c0c3c3f373..b071fb7c9f 100644 --- a/xfa/fwl/core/cfwl_event.h +++ b/xfa/fwl/core/cfwl_event.h @@ -21,7 +21,6 @@ enum class CFWL_EventType { CheckWord, Click, Close, - DrawItem, EditChanged, Key, KillFocus, diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp index 68d8cc97f8..5a49dcc850 100644 --- a/xfa/fwl/core/ifwl_combobox.cpp +++ b/xfa/fwl/core/ifwl_combobox.cpp @@ -847,16 +847,7 @@ void IFWL_ComboBox::OnProcessMessage(CFWL_Message* pMessage) { void IFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) { CFWL_EventType dwFlag = pEvent->GetClassID(); - if (dwFlag == CFWL_EventType::DrawItem) { - CFWL_EvtLtbDrawItem* pDrawItemEvent = - static_cast(pEvent); - CFWL_EvtCmbDrawItem pTemp; - pTemp.m_pSrcTarget = this; - pTemp.m_pGraphics = pDrawItemEvent->m_pGraphics; - pTemp.m_index = pDrawItemEvent->m_index; - pTemp.m_rtItem = pDrawItemEvent->m_rect; - DispatchEvent(&pTemp); - } else if (dwFlag == CFWL_EventType::Scroll) { + if (dwFlag == CFWL_EventType::Scroll) { CFWL_EvtScroll* pScrollEvent = static_cast(pEvent); CFWL_EvtScroll pScrollEv; pScrollEv.m_pSrcTarget = this; diff --git a/xfa/fwl/core/ifwl_combobox.h b/xfa/fwl/core/ifwl_combobox.h index 8b045a8780..5b6657baef 100644 --- a/xfa/fwl/core/ifwl_combobox.h +++ b/xfa/fwl/core/ifwl_combobox.h @@ -56,13 +56,6 @@ FWL_EVENT_DEF(CFWL_EvtCmbSelChanged, CFX_Int32Array iArraySels; bool bLButtonUp;) -FWL_EVENT_DEF(CFWL_EvtCmbDrawItem, - CFWL_EventType::DrawItem, - CFX_Graphics* m_pGraphics; - CFX_Matrix m_matrix; - int32_t m_index; - CFX_RectF m_rtItem;) - class IFWL_ComboBoxDP : public IFWL_ListBoxDP { public: virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget) = 0; diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp index 1f5a50c4c8..4a8f9395b6 100644 --- a/xfa/fwl/core/ifwl_listbox.cpp +++ b/xfa/fwl/core/ifwl_listbox.cpp @@ -510,17 +510,8 @@ void IFWL_ListBox::DrawItems(CFX_Graphics* pGraphics, if (bMultiCol && rtItem.left > m_rtConent.right()) break; - if (GetStylesEx() & FWL_STYLEEXT_LTB_OwnerDraw) { - CFWL_EvtLtbDrawItem ev; - ev.m_pSrcTarget = this; - ev.m_pGraphics = pGraphics; - ev.m_matrix = *pMatrix; - ev.m_index = i; - ev.m_rect = rtItem; - DispatchEvent(&ev); - } else { + if (!(GetStylesEx() & FWL_STYLEEXT_LTB_OwnerDraw)) DrawItem(pGraphics, pTheme, pItem, i, rtItem, pMatrix); - } } } diff --git a/xfa/fwl/core/ifwl_listbox.h b/xfa/fwl/core/ifwl_listbox.h index 42886d17e0..48d4522009 100644 --- a/xfa/fwl/core/ifwl_listbox.h +++ b/xfa/fwl/core/ifwl_listbox.h @@ -42,13 +42,6 @@ FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, CFWL_EventType::SelectChanged, CFX_Int32Array iarraySels;) -FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, - CFWL_EventType::DrawItem, - CFX_Graphics* m_pGraphics; - CFX_Matrix m_matrix; - int32_t m_index; - CFX_RectF m_rect;) - class IFWL_ListBoxDP : public IFWL_DataProvider { public: virtual int32_t CountItems(const IFWL_Widget* pWidget) const = 0; -- cgit v1.2.3