Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: xfa/fwl/core/fwl_formimp.h

Issue 2001203002: Correctly implement GetPartState() function (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: change type Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_formimp.h
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index 9d2d394d0369733e07ff67faf7fdb9747459f830..e1da960813b0399540f0868d7e51d669cc63d20a 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698