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/core/fwl_widgetimp.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/core/fwl_widgetimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_widgetimp.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index 38516c6557..b9db4f984e 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -118,7 +118,7 @@ FWL_ERR IFWL_Widget::LockUpdate() { FWL_ERR IFWL_Widget::UnlockUpdate() { return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); } -uint32_t IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { +FWL_WidgetHit IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); } FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, @@ -365,27 +365,24 @@ FWL_ERR CFWL_WidgetImp::UnlockUpdate() { } return FWL_ERR_Succeeded; } -uint32_t CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { +FWL_WidgetHit CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtClient; GetClientRect(rtClient); - if (rtClient.Contains(fx, fy)) { - return FWL_WGTHITTEST_Client; - } + if (rtClient.Contains(fx, fy)) + return FWL_WidgetHit::Client; if (HasEdge()) { CFX_RectF rtEdge; GetEdgeRect(rtEdge); - if (rtEdge.Contains(fx, fy)) { - return FWL_WGTHITTEST_Edge; - } + if (rtEdge.Contains(fx, fy)) + return FWL_WidgetHit::Edge; } if (HasBorder()) { CFX_RectF rtRelative; GetRelativeRect(rtRelative); - if (rtRelative.Contains(fx, fy)) { - return FWL_WGTHITTEST_Border; - } + if (rtRelative.Contains(fx, fy)) + return FWL_WidgetHit::Border; } - return FWL_WGTHITTEST_Unknown; + return FWL_WidgetHit::Unknown; } FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, |