diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-03 13:00:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-03 13:00:25 -0700 |
commit | 89fcde88f0c03da77d7fd83dece7726d66fd190e (patch) | |
tree | 509e8ee5c74480d1c60892c5868f0b888808f6b9 /xfa/fwl/basewidget/fwl_spinbuttonimp.cpp | |
parent | 5fc4f31285c3a88fc157fd2d9b9cf2eb5c7cabed (diff) | |
download | pdfium-89fcde88f0c03da77d7fd83dece7726d66fd190e.tar.xz |
Remove FWL_WGTHITTEST_* defines in favour of enum class.
This Cl updates the FWL_WGTHITTEST_ defines to an enum class and fixes up any
code issues.
Review-Url: https://codereview.chromium.org/1948583002
Diffstat (limited to 'xfa/fwl/basewidget/fwl_spinbuttonimp.cpp')
-rw-r--r-- | xfa/fwl/basewidget/fwl_spinbuttonimp.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp index 434f6ddacf..5692087762 100644 --- a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp +++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp @@ -100,27 +100,22 @@ FWL_ERR CFWL_SpinButtonImp::Update() { } return FWL_ERR_Succeeded; } -uint32_t CFWL_SpinButtonImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { - if (m_rtClient.Contains(fx, fy)) { - return FWL_WGTHITTEST_Client; - } - if (HasBorder() && (m_rtClient.Contains(fx, fy))) { - return FWL_WGTHITTEST_Border; - } +FWL_WidgetHit CFWL_SpinButtonImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { + if (m_rtClient.Contains(fx, fy)) + return FWL_WidgetHit::Client; + if (HasBorder() && (m_rtClient.Contains(fx, fy))) + return FWL_WidgetHit::Border; if (HasEdge()) { CFX_RectF rtEdge; GetEdgeRect(rtEdge); - if (rtEdge.Contains(fx, fy)) { - return FWL_WGTHITTEST_Left; - } - } - if (m_rtUpButton.Contains(fx, fy)) { - return FWL_WGTHITTEST_SPB_UpButton; - } - if (m_rtDnButton.Contains(fx, fy)) { - return FWL_WGTHITTEST_SPB_DownButton; - } - return FWL_WGTHITTEST_Unknown; + if (rtEdge.Contains(fx, fy)) + return FWL_WidgetHit::Left; + } + if (m_rtUpButton.Contains(fx, fy)) + return FWL_WidgetHit::UpButton; + if (m_rtDnButton.Contains(fx, fy)) + return FWL_WidgetHit::DownButton; + return FWL_WidgetHit::Unknown; } FWL_ERR CFWL_SpinButtonImp::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { |