diff options
author | weili <weili@chromium.org> | 2016-05-20 15:16:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-20 15:16:18 -0700 |
commit | dc3ccdfb49c4d533d524d2084a7ebe5117f35934 (patch) | |
tree | c8f29976a7528c61e78aba12b755110d7c8da845 /xfa/fwl/theme | |
parent | 7aaaae625557f387cf7c829614e397fbf43578b6 (diff) | |
download | pdfium-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.cpp | 20 |
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(); |