summaryrefslogtreecommitdiff
path: root/xfa/src/fwl
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 14:31:56 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 14:31:56 -0800
commit007e6c0f9559412788b903bcb6a7601e220c3be8 (patch)
treea2c6bb85eaa2b63fd24ed70fd3c6ddad54e219d5 /xfa/src/fwl
parent281a9eadff15b167e2ee3032e21b83190ad49125 (diff)
downloadpdfium-007e6c0f9559412788b903bcb6a7601e220c3be8.tar.xz
Remove some FX_BOOLs
Grepping for FX_BOOL and |==| on the same line gives a very strong clue that the expression won't be out of range of the |bool| type iteself. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1736323003 .
Diffstat (limited to 'xfa/src/fwl')
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp12
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_listboximp.cpp6
-rw-r--r--xfa/src/fwl/src/theme/checkboxtp.cpp9
3 files changed, 12 insertions, 15 deletions
diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
index b963e1daf8..88add897b7 100644
--- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp
@@ -1526,15 +1526,13 @@ void CFWL_ComboBoxImpDelegate::OnKey(CFWL_MsgKey* pMsg) {
m_pOwner->DispatchKeyEvent(pMsg);
return;
}
- FX_BOOL bSubCtrlKey = pMsg->m_pDstTarget == m_pOwner->m_pInterface;
- if (bSubCtrlKey) {
+ if (pMsg->m_pDstTarget == m_pOwner->m_pInterface)
DoSubCtrlKey(pMsg);
- }
}
void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey* pMsg) {
FX_DWORD dwKeyCode = pMsg->m_dwKeyCode;
- FX_BOOL bUp = dwKeyCode == FWL_VKEY_Up;
- FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down;
+ const bool bUp = dwKeyCode == FWL_VKEY_Up;
+ const bool bDown = dwKeyCode == FWL_VKEY_Down;
if (bUp || bDown) {
int32_t iCount = static_cast<CFWL_ComboListImp*>(
m_pOwner->m_pListBox->GetImpl())->CountItems();
@@ -1684,8 +1682,8 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
}
void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) {
FX_DWORD dwKeyCode = pMsg->m_dwKeyCode;
- FX_BOOL bUp = dwKeyCode == FWL_VKEY_Up;
- FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down;
+ const bool bUp = dwKeyCode == FWL_VKEY_Up;
+ const bool bDown = dwKeyCode == FWL_VKEY_Down;
if (bUp || bDown) {
CFWL_ComboListImp* pComboList =
static_cast<CFWL_ComboListImp*>(m_pOwner->m_pListBox->GetImpl());
diff --git a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
index e924b8b791..1f77f7ad94 100644
--- a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
@@ -332,9 +332,9 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItem(FWL_HLISTITEM hItem,
case FWL_VKEY_Down:
case FWL_VKEY_Home:
case FWL_VKEY_End: {
- FX_BOOL bUp = dwKeyCode == FWL_VKEY_Up;
- FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down;
- FX_BOOL bHome = dwKeyCode == FWL_VKEY_Home;
+ const bool bUp = dwKeyCode == FWL_VKEY_Up;
+ const bool bDown = dwKeyCode == FWL_VKEY_Down;
+ const bool bHome = dwKeyCode == FWL_VKEY_Home;
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
int32_t iDstItem = -1;
diff --git a/xfa/src/fwl/src/theme/checkboxtp.cpp b/xfa/src/fwl/src/theme/checkboxtp.cpp
index 85dd01f85f..b288e5f19f 100644
--- a/xfa/src/fwl/src/theme/checkboxtp.cpp
+++ b/xfa/src/fwl/src/theme/checkboxtp.cpp
@@ -49,11 +49,10 @@ FX_DWORD CFWL_CheckBoxTP::SetThemeID(IFWL_Widget* pWidget,
FX_BOOL CFWL_CheckBoxTP::DrawText(CFWL_ThemeText* pParams) {
if (!m_pTextOut)
return FALSE;
- FX_BOOL bDisable = (pParams->m_dwStates & FWL_PARTSTATE_CKB_Mask1) ==
- FWL_PARTSTATE_CKB_Disabled;
- FX_ARGB argText =
- bDisable ? FWLTHEME_CAPACITY_TextDisColor : FWLTHEME_CAPACITY_TextColor;
- m_pTextOut->SetTextColor(argText);
+ m_pTextOut->SetTextColor((pParams->m_dwStates & FWL_PARTSTATE_CKB_Mask1) ==
+ FWL_PARTSTATE_CKB_Disabled
+ ? FWLTHEME_CAPACITY_TextDisColor
+ : FWLTHEME_CAPACITY_TextColor);
return CFWL_WidgetTP::DrawText(pParams);
}
FX_BOOL CFWL_CheckBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) {