From b4d40ffae3f955fab2fac838430c89aca452c45f Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 5 May 2016 10:28:02 -0700 Subject: Remove CLASSHASH defines in favour of an enum class. This Cl updates all the CLASSHASH defines to use an enum class. A few defines where unabled and were either updated or removed if the number no longer exists in the code base. Review-Url: https://codereview.chromium.org/1946213003 --- xfa/fwl/core/fwl_widgetimp.cpp | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'xfa/fwl/core/fwl_widgetimp.cpp') diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index f45a66cc2d..e72a7f385a 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -23,7 +23,6 @@ #include "xfa/fwl/core/ifwl_themeprovider.h" #include "xfa/fxfa/include/xfa_ffapp.h" -#define FWL_CLASSHASH_Menu 3957949655 #define FWL_STYLEEXT_MNU_Vert (1L << 0) IFWL_Widget::~IFWL_Widget() {} @@ -32,7 +31,7 @@ FWL_Error IFWL_Widget::GetClassName(CFX_WideString& wsClass) const { return m_pImpl->GetClassName(wsClass); } -uint32_t IFWL_Widget::GetClassID() const { +FWL_Type IFWL_Widget::GetClassID() const { return m_pImpl->GetClassID(); } @@ -191,10 +190,6 @@ FWL_Error CFWL_WidgetImp::GetClassName(CFX_WideString& wsClass) const { return FWL_Error::Succeeded; } -uint32_t CFWL_WidgetImp::GetClassID() const { - return 0; -} - FX_BOOL CFWL_WidgetImp::IsInstance(const CFX_WideStringC& wsClass) const { return FALSE; } @@ -709,30 +704,26 @@ void CFWL_WidgetImp::SetGrab(FX_BOOL bSet) { static_cast(pApp->GetNoteDriver()); pDriver->SetGrab(m_pInterface, bSet); } + FX_BOOL CFWL_WidgetImp::GetPopupPos(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF& rtAnchor, CFX_RectF& rtPopup) { - if (GetClassID() == FWL_CLASSHASH_Menu) { - return GetPopupPosMenu(fMinHeight, fMaxHeight, rtAnchor, rtPopup); - } else { - if (GetClassID() == FWL_CLASSHASH_ComboBox) { - if (m_pWidgetMgr->IsFormDisabled()) { - return m_pWidgetMgr->GetAdapterPopupPos(m_pInterface, fMinHeight, - fMaxHeight, rtAnchor, rtPopup); - } else { - return GetPopupPosComboBox(fMinHeight, fMaxHeight, rtAnchor, rtPopup); - } - } else if (GetClassID() == FWL_CLASSHASH_DateTimePicker && - m_pWidgetMgr->IsFormDisabled()) { + if (GetClassID() == FWL_Type::ComboBox) { + if (m_pWidgetMgr->IsFormDisabled()) { return m_pWidgetMgr->GetAdapterPopupPos(m_pInterface, fMinHeight, fMaxHeight, rtAnchor, rtPopup); - } else { - return GetPopupPosGeneral(fMinHeight, fMaxHeight, rtAnchor, rtPopup); } + return GetPopupPosComboBox(fMinHeight, fMaxHeight, rtAnchor, rtPopup); } - return FALSE; + if (GetClassID() == FWL_Type::DateTimePicker && + m_pWidgetMgr->IsFormDisabled()) { + return m_pWidgetMgr->GetAdapterPopupPos(m_pInterface, fMinHeight, + fMaxHeight, rtAnchor, rtPopup); + } + return GetPopupPosGeneral(fMinHeight, fMaxHeight, rtAnchor, rtPopup); } + FX_BOOL CFWL_WidgetImp::GetPopupPosMenu(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF& rtAnchor, -- cgit v1.2.3