diff options
author | weili <weili@chromium.org> | 2016-05-24 15:34:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-24 15:34:59 -0700 |
commit | 5aaa9bc9193d74bb188dd1f890140cf38fb06605 (patch) | |
tree | 0052463cb60cdc30ee6599efcee1fc47dd0c5a63 /xfa | |
parent | 7a213d9e27fd7d35359183ab5fc95aae186e6722 (diff) | |
download | pdfium-5aaa9bc9193d74bb188dd1f890140cf38fb06605.tar.xz |
Correctly implement GetPartState() function
The original function doesn't seem right. Re-implement it.
Review-Url: https://codereview.chromium.org/2001203002
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fwl/core/fwl_formimp.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h index 9d2d394d03..e1da960813 100644 --- a/xfa/fwl/core/fwl_formimp.h +++ b/xfa/fwl/core/fwl_formimp.h @@ -47,8 +47,14 @@ class CFWL_SysBtn { bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled; } - int32_t GetPartState() { - return (IsDisabled() ? CFWL_PartState_Disabled : (m_dwState + 1)); + uint32_t GetPartState() { + if (IsDisabled()) + return CFWL_PartState_Disabled; + if (m_dwState & FWL_SYSBUTTONSTATE_Pressed) + return CFWL_PartState_Pressed; + if (m_dwState & FWL_SYSBUTTONSTATE_Hover) + return CFWL_PartState_Hovered; + return CFWL_PartState_Normal; } CFX_RectF m_rtBtn; |