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

Unified Diff: xfa/fwl/theme/cfwl_formtp.cpp

Issue 2016243003: Fix two bugs found by /analyze tool (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 | « xfa/fwl/theme/cfwl_checkboxtp.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/theme/cfwl_formtp.cpp
diff --git a/xfa/fwl/theme/cfwl_formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp
index 971e738765ec6a70f0cea6419995d6909efdaee5..033375911b671ad85e91b344b41d31b22275e881 100644
--- a/xfa/fwl/theme/cfwl_formtp.cpp
+++ b/xfa/fwl/theme/cfwl_formtp.cpp
@@ -78,25 +78,17 @@ FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) {
if (!pParams)
return FALSE;
int32_t iActive = 0;
- if (pParams->m_dwStates & CFWL_PartState_Inactive) {
+ if (pParams->m_dwStates & CFWL_PartState_Inactive)
iActive = 1;
- }
+
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;
- }
- default: {}
- }
+ 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;
+
switch (pParams->m_iPart) {
case CFWL_Part::Border: {
DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState,
« no previous file with comments | « xfa/fwl/theme/cfwl_checkboxtp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698