summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-04 13:38:11 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-04 13:38:11 -0700
commit7d89e728a450c681c53d40d7f67ee2eef0400705 (patch)
treea82e90ff7b65382965395a7b323cfbc7ea5009f4 /xfa/fwl/core
parent10b01bf44695ce9a354660b16f607da70727a846 (diff)
downloadpdfium-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')
-rw-r--r--xfa/fwl/core/fwl_formimp.h2
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp56
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.cpp9
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.h4
4 files changed, 27 insertions, 44 deletions
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index 4ee3e0ddae..d8bc80522e 100644
--- a/xfa/fwl/core/fwl_formimp.h
+++ b/xfa/fwl/core/fwl_formimp.h
@@ -32,7 +32,7 @@ class CFWL_SysBtn {
m_dwState = 0;
}
- FX_BOOL IsDisabled() { return m_dwState & FWL_SYSBUTTONSTATE_Disabled; }
+ bool IsDisabled() { return !!(m_dwState & FWL_SYSBUTTONSTATE_Disabled); }
void SetNormal() { m_dwState &= 0xFFF0; }
void SetPressed() {
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;
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index 02b63862e5..1985cbdeaf 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -667,12 +667,15 @@ FX_BOOL CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) {
FWL_WGTSTYLE_OverLapper) ||
(dwStyles & FWL_WGTSTYLE_Popup);
}
-FX_BOOL CFWL_WidgetMgr::IsThreadEnabled() {
+
+bool CFWL_WidgetMgr::IsThreadEnabled() {
return !(m_dwCapability & FWL_WGTMGR_DisableThread);
}
-FX_BOOL CFWL_WidgetMgr::IsFormDisabled() {
- return m_dwCapability & FWL_WGTMGR_DisableForm;
+
+bool CFWL_WidgetMgr::IsFormDisabled() {
+ return !!(m_dwCapability & FWL_WGTMGR_DisableForm);
}
+
FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget,
FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.h b/xfa/fwl/core/fwl_widgetmgrimp.h
index 0b4e2bf79d..0fcd057aeb 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.h
+++ b/xfa/fwl/core/fwl_widgetmgrimp.h
@@ -120,8 +120,8 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr {
IFWL_AdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; }
CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; }
CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget);
- FX_BOOL IsThreadEnabled();
- FX_BOOL IsFormDisabled();
+ bool IsThreadEnabled();
+ bool IsFormDisabled();
FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget,
FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,