Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: xfa/fwl/core/fwl_noteimp.cpp

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_noteimp.cpp
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 39afa783c0326420409f982e286c8f47a36dfb45..41e749fc9ad61bdd00be272c26e245aba0b53b9e 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;
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698