summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/fwl_widgetimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-05 10:28:02 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-05 10:28:03 -0700
commitb4d40ffae3f955fab2fac838430c89aca452c45f (patch)
tree046c0a461e9dc0dc295da5839b831e4b53526541 /xfa/fwl/core/fwl_widgetimp.cpp
parent439bb9e0b2f72cd1ede65b84130fe9ed573f74b0 (diff)
downloadpdfium-b4d40ffae3f955fab2fac838430c89aca452c45f.tar.xz
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
Diffstat (limited to 'xfa/fwl/core/fwl_widgetimp.cpp')
-rw-r--r--xfa/fwl/core/fwl_widgetimp.cpp33
1 files changed, 12 insertions, 21 deletions
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<CFWL_NoteDriver*>(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,