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

Side by Side Diff: xfa/fwl/theme/cfwl_checkboxtp.cpp

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. 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 unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/fwl_widgetmgrimp.cpp ('k') | xfa/fxfa/app/xfa_ffwidget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/theme/cfwl_checkboxtp.h" 7 #include "xfa/fwl/theme/cfwl_checkboxtp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/basewidget/ifwl_checkbox.h" 10 #include "xfa/fwl/basewidget/ifwl_checkbox.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 uint32_t dwStates, 107 uint32_t dwStates,
108 CFX_Matrix* pMatrix) { 108 CFX_Matrix* pMatrix) {
109 dwStates &= 0x03; 109 dwStates &= 0x03;
110 int32_t fillMode = FXFILL_WINDING; 110 int32_t fillMode = FXFILL_WINDING;
111 uint32_t dwStyleEx = pWidget->GetStylesEx(); 111 uint32_t dwStyleEx = pWidget->GetStylesEx();
112 dwStyleEx &= FWL_STYLEEXT_CKB_ShapeMask; 112 dwStyleEx &= FWL_STYLEEXT_CKB_ShapeMask;
113 CFX_Path path; 113 CFX_Path path;
114 path.Create(); 114 path.Create();
115 FX_FLOAT fRight = pRect->right(); 115 FX_FLOAT fRight = pRect->right();
116 FX_FLOAT fBottom = pRect->bottom(); 116 FX_FLOAT fBottom = pRect->bottom();
117 FX_BOOL bClipSign = dwStates & CFWL_PartState_Hovered; 117 bool bClipSign = !!(dwStates & CFWL_PartState_Hovered);
118 if ((dwStyleEx == FWL_STYLEEXT_CKB_ShapeSolidSquare) || 118 if ((dwStyleEx == FWL_STYLEEXT_CKB_ShapeSolidSquare) ||
119 (dwStyleEx == FWL_STYLEEXT_CKB_ShapeSunkenSquare)) { 119 (dwStyleEx == FWL_STYLEEXT_CKB_ShapeSunkenSquare)) {
120 path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); 120 path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
121 if (bClipSign) { 121 if (bClipSign) {
122 fillMode = FXFILL_ALTERNATE; 122 fillMode = FXFILL_ALTERNATE;
123 path.AddRectangle(pRect->left + CHECKBOX_SIZE_SIGNMARGIN, 123 path.AddRectangle(pRect->left + CHECKBOX_SIZE_SIGNMARGIN,
124 pRect->top + CHECKBOX_SIZE_SIGNMARGIN, 124 pRect->top + CHECKBOX_SIZE_SIGNMARGIN,
125 pRect->width - CHECKBOX_SIZE_SIGNMARGIN * 2, 125 pRect->width - CHECKBOX_SIZE_SIGNMARGIN * 2,
126 pRect->height - CHECKBOX_SIZE_SIGNMARGIN * 2); 126 pRect->height - CHECKBOX_SIZE_SIGNMARGIN * 2);
127 } 127 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 pt1.x + px2 * FWLTHEME_BEZIER, 498 pt1.x + px2 * FWLTHEME_BEZIER,
499 pt1.y + py2 * FWLTHEME_BEZIER, pt1.x, pt1.y); 499 pt1.y + py2 * FWLTHEME_BEZIER, pt1.x, pt1.y);
500 FX_FLOAT fScale = fCheckLen / CHECKBOX_SIZE_SIGNPATH; 500 FX_FLOAT fScale = fCheckLen / CHECKBOX_SIZE_SIGNPATH;
501 CFX_Matrix mt; 501 CFX_Matrix mt;
502 mt.Set(1, 0, 0, 1, 0, 0); 502 mt.Set(1, 0, 0, 1, 0, 0);
503 mt.Scale(fScale, fScale); 503 mt.Scale(fScale, fScale);
504 CFX_PathData* pData = m_pCheckPath->GetPathData(); 504 CFX_PathData* pData = m_pCheckPath->GetPathData();
505 pData->Transform(&mt); 505 pData->Transform(&mt);
506 } 506 }
507 } 507 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_widgetmgrimp.cpp ('k') | xfa/fxfa/app/xfa_ffwidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698