summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-05-20 15:16:18 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-20 15:16:18 -0700
commitdc3ccdfb49c4d533d524d2084a7ebe5117f35934 (patch)
treec8f29976a7528c61e78aba12b755110d7c8da845 /xfa/fwl/theme
parent7aaaae625557f387cf7c829614e397fbf43578b6 (diff)
downloadpdfium-dc3ccdfb49c4d533d524d2084a7ebe5117f35934.tar.xz
Fix a bug on scrollbar's checking theme states
The current switch statement will never execute any branch other than falling to default. The intention should be checking on the specific state bits. BUG=613623, 427616 Review-Url: https://codereview.chromium.org/2002643003
Diffstat (limited to 'xfa/fwl/theme')
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 54dfbe5531..aa801adb6e 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -51,20 +51,12 @@ FX_BOOL CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) {
return FALSE;
IFWL_Widget* pWidget = pParams->m_pWidget;
FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
- switch (pParams->m_dwStates & 0x03) {
- case CFWL_PartState_Hovered: {
- eState = FWLTHEME_STATE_Hover;
- break;
- }
- case CFWL_PartState_Pressed: {
- eState = FWLTHEME_STATE_Pressed;
- break;
- }
- case CFWL_PartState_Disabled: {
- eState = FWLTHEME_STATE_Disabale;
- break;
- }
- }
+ if (pParams->m_dwStates & CFWL_PartState_Hovered)
+ eState = FWLTHEME_STATE_Hover;
+ else if (pParams->m_dwStates & CFWL_PartState_Pressed)
+ eState = FWLTHEME_STATE_Pressed;
+ else if (pParams->m_dwStates & CFWL_PartState_Disabled)
+ eState = FWLTHEME_STATE_Disabale;
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RectF* pRect = &pParams->m_rtPart;
FX_BOOL bVert = pWidget->GetStylesEx();