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

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

Issue 2571913002: Avoid the ptr.reset(new XXX()) anti-pattern (Closed)
Patch Set: rebase Created 4 years 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/cfwl_widgetmgr.cpp ('k') | xfa/fwl/theme/cfwl_widgettp.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 "core/fxge/cfx_pathdata.h" 9 #include "core/fxge/cfx_pathdata.h"
10 #include "third_party/base/ptr_util.h"
10 #include "xfa/fde/tto/fde_textout.h" 11 #include "xfa/fde/tto/fde_textout.h"
11 #include "xfa/fwl/cfwl_checkbox.h" 12 #include "xfa/fwl/cfwl_checkbox.h"
12 #include "xfa/fwl/cfwl_themebackground.h" 13 #include "xfa/fwl/cfwl_themebackground.h"
13 #include "xfa/fwl/cfwl_themetext.h" 14 #include "xfa/fwl/cfwl_themetext.h"
14 #include "xfa/fwl/cfwl_widget.h" 15 #include "xfa/fwl/cfwl_widget.h"
15 #include "xfa/fxgraphics/cfx_color.h" 16 #include "xfa/fxgraphics/cfx_color.h"
16 #include "xfa/fxgraphics/cfx_path.h" 17 #include "xfa/fxgraphics/cfx_path.h"
17 18
18 namespace { 19 namespace {
19 20
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 m_pThemeData->clrSignBorderDisable = ArgbEncode(255, 202, 200, 187); 213 m_pThemeData->clrSignBorderDisable = ArgbEncode(255, 202, 200, 187);
213 m_pThemeData->clrSignCheck = ArgbEncode(255, 28, 81, 128); 214 m_pThemeData->clrSignCheck = ArgbEncode(255, 28, 81, 128);
214 m_pThemeData->clrSignNeutral = ArgbEncode(255, 28, 134, 26); 215 m_pThemeData->clrSignNeutral = ArgbEncode(255, 28, 134, 26);
215 m_pThemeData->clrSignNeutralNormal = ArgbEncode(255, 114, 192, 113); 216 m_pThemeData->clrSignNeutralNormal = ArgbEncode(255, 114, 192, 113);
216 m_pThemeData->clrSignNeutralHover = ArgbEncode(255, 33, 161, 33); 217 m_pThemeData->clrSignNeutralHover = ArgbEncode(255, 33, 161, 33);
217 m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26); 218 m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26);
218 } 219 }
219 220
220 void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) { 221 void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) {
221 if (!m_pCheckPath) { 222 if (!m_pCheckPath) {
222 m_pCheckPath.reset(new CFX_Path); 223 m_pCheckPath = pdfium::MakeUnique<CFX_Path>();
223 m_pCheckPath->Create(); 224 m_pCheckPath->Create();
224 FX_FLOAT fWidth = kSignPath; 225 FX_FLOAT fWidth = kSignPath;
225 FX_FLOAT fHeight = -kSignPath; 226 FX_FLOAT fHeight = -kSignPath;
226 FX_FLOAT fBottom = kSignPath; 227 FX_FLOAT fBottom = kSignPath;
227 CFX_PointF pt1(fWidth / 15.0f, fBottom + fHeight * 2 / 5.0f); 228 CFX_PointF pt1(fWidth / 15.0f, fBottom + fHeight * 2 / 5.0f);
228 CFX_PointF pt2(fWidth / 4.5f, fBottom + fHeight / 16.0f); 229 CFX_PointF pt2(fWidth / 4.5f, fBottom + fHeight / 16.0f);
229 CFX_PointF pt3(fWidth / 3.0f, fBottom); 230 CFX_PointF pt3(fWidth / 3.0f, fBottom);
230 CFX_PointF pt4(fWidth * 14 / 15.0f, fBottom + fHeight * 15 / 16.0f); 231 CFX_PointF pt4(fWidth * 14 / 15.0f, fBottom + fHeight * 15 / 16.0f);
231 CFX_PointF pt5(fWidth / 3.6f, fBottom + fHeight / 3.5f); 232 CFX_PointF pt5(fWidth / 3.6f, fBottom + fHeight / 3.5f);
232 CFX_PointF pt12(fWidth / 7.0f, fBottom + fHeight * 2 / 7.0f); 233 CFX_PointF pt12(fWidth / 7.0f, fBottom + fHeight * 2 / 7.0f);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 case FWL_STYLEEXT_CKB_SignShapeSquare: 324 case FWL_STYLEEXT_CKB_SignShapeSquare:
324 DrawSignSquare(pGraphics, &rtSign, dwColor, pMatrix); 325 DrawSignSquare(pGraphics, &rtSign, dwColor, pMatrix);
325 break; 326 break;
326 case FWL_STYLEEXT_CKB_SignShapeStar: 327 case FWL_STYLEEXT_CKB_SignShapeStar:
327 DrawSignStar(pGraphics, &rtSign, dwColor, pMatrix); 328 DrawSignStar(pGraphics, &rtSign, dwColor, pMatrix);
328 break; 329 break;
329 default: 330 default:
330 break; 331 break;
331 } 332 }
332 } 333 }
OLDNEW
« no previous file with comments | « xfa/fwl/cfwl_widgetmgr.cpp ('k') | xfa/fwl/theme/cfwl_widgettp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698