diff options
author | weili <weili@chromium.org> | 2016-05-27 14:48:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-27 14:48:10 -0700 |
commit | bbff41927ecce2ff93668aa615307f548ca896eb (patch) | |
tree | fd0d8b7a0c535fb3fb5c0fff0167810f1b9050eb /xfa/fwl/theme/cfwl_checkboxtp.cpp | |
parent | d23df55b95716a4b6021ab600b99fd31954c8052 (diff) | |
download | pdfium-bbff41927ecce2ff93668aa615307f548ca896eb.tar.xz |
Fix two bugs found by /analyze tool
The first one is about bitwise AND on zero, the result would always
be zero. The second one is about using wrong bitmasks, the result would cause branches never get executed.
BUG=chromium:613623, chromium:427616
Review-Url: https://codereview.chromium.org/2016243003
Diffstat (limited to 'xfa/fwl/theme/cfwl_checkboxtp.cpp')
-rw-r--r-- | xfa/fwl/theme/cfwl_checkboxtp.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index 9a10c60a3d..23cc21f360 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.cpp +++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp @@ -166,22 +166,21 @@ void CFWL_CheckBoxTP::DrawSign(IFWL_Widget* pWidget, CFX_RectF rtSign(*pRtBox); rtSign.Deflate(kSignMargin, kSignMargin); uint32_t dwColor = m_pThemeData->clrSignCheck; - FX_BOOL bCheck = TRUE; + bool bCheck = true; if ((dwStates & CFWL_PartState_Disabled) && (dwStates & CFWL_PartState_Checked)) { dwColor = m_pThemeData->clrSignBorderDisable; } else if (dwStates & CFWL_PartState_Neutral) { - if (dwStates & CFWL_PartState_Normal) { - bCheck = FALSE; - dwColor = m_pThemeData->clrSignNeutralNormal; - } else if (dwStates & CFWL_PartState_Hovered) { - bCheck = FALSE; + if (dwStates & CFWL_PartState_Hovered) { dwColor = m_pThemeData->clrSignNeutralHover; } else if (dwStates & CFWL_PartState_Pressed) { - bCheck = FALSE, dwColor = m_pThemeData->clrSignNeutralPressed; + dwColor = m_pThemeData->clrSignNeutralPressed; } else if (dwStates & CFWL_PartState_Disabled) { - bCheck = FALSE, dwColor = m_pThemeData->clrSignBorderDisable; + dwColor = m_pThemeData->clrSignBorderDisable; + } else { + dwColor = m_pThemeData->clrSignNeutralNormal; } + bCheck = false; } if (bCheck) { uint32_t dwStyle = pWidget->GetStylesEx(); |