diff options
author | tsepez <tsepez@chromium.org> | 2016-05-04 13:38:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-04 13:38:11 -0700 |
commit | 7d89e728a450c681c53d40d7f67ee2eef0400705 (patch) | |
tree | a82e90ff7b65382965395a7b323cfbc7ea5009f4 /xfa/fwl/core/fwl_noteimp.cpp | |
parent | 10b01bf44695ce9a354660b16f607da70727a846 (diff) | |
download | pdfium-7d89e728a450c681c53d40d7f67ee2eef0400705.tar.xz |
Return bool rather than bitwise-and for FX_BOOL
Investigate results of:
git grep -ni 'return [(]*[a-z0-9_]* &[^&]'
git grep -ni 'BOOL.*= [(]*[a-z0-9_]* &[^&]'
Review-Url: https://codereview.chromium.org/1951653002
Diffstat (limited to 'xfa/fwl/core/fwl_noteimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_noteimp.cpp | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index 39afa783c0..41e749fc9a 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -810,47 +810,27 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) { if (dwFilter == FWL_EVENT_ALL_MASK) return TRUE; - FX_BOOL bRet = FALSE; switch (pEvent->GetClassID()) { - case CFWL_EventType::Mouse: { - bRet = dwFilter & FWL_EVENT_MOUSE_MASK; - break; - } - case CFWL_EventType::MouseWheel: { - bRet = dwFilter & FWL_EVENT_MOUSEWHEEL_MASK; - break; - } - case CFWL_EventType::Key: { - bRet = dwFilter & FWL_EVENT_KEY_MASK; - break; - } + case CFWL_EventType::Mouse: + return !!(dwFilter & FWL_EVENT_MOUSE_MASK); + case CFWL_EventType::MouseWheel: + return !!(dwFilter & FWL_EVENT_MOUSEWHEEL_MASK); + case CFWL_EventType::Key: + return !!(dwFilter & FWL_EVENT_KEY_MASK); case CFWL_EventType::SetFocus: - case CFWL_EventType::KillFocus: { - bRet = dwFilter & FWL_EVENT_FOCUSCHANGED_MASK; - break; - } - case CFWL_EventType::Draw: { - bRet = dwFilter & FWL_EVENT_DRAW_MASK; - break; - } - case CFWL_EventType::Close: { - bRet = dwFilter & FWL_EVENT_CLOSE_MASK; - break; - } - case CFWL_EventType::SizeChanged: { - bRet = dwFilter & FWL_EVENT_SIZECHANGED_MASK; - break; - } - case CFWL_EventType::Idle: { - bRet = dwFilter & FWL_EVENT_IDLE_MASK; - break; - } - default: { - bRet = dwFilter & FWL_EVENT_CONTROL_MASK; - break; - } + case CFWL_EventType::KillFocus: + return !!(dwFilter & FWL_EVENT_FOCUSCHANGED_MASK); + case CFWL_EventType::Draw: + return !!(dwFilter & FWL_EVENT_DRAW_MASK); + case CFWL_EventType::Close: + return !!(dwFilter & FWL_EVENT_CLOSE_MASK); + case CFWL_EventType::SizeChanged: + return !!(dwFilter & FWL_EVENT_SIZECHANGED_MASK); + case CFWL_EventType::Idle: + return !!(dwFilter & FWL_EVENT_IDLE_MASK); + default: + return !!(dwFilter & FWL_EVENT_CONTROL_MASK); } - return bRet; } CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL; |