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

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

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase 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/theme/cfwl_pushbuttontp.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_scrollbartp.h" 7 #include "xfa/fwl/theme/cfwl_scrollbartp.h"
8 8
9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" 9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h"
10 #include "xfa/fwl/core/cfwl_themebackground.h" 10 #include "xfa/fwl/core/cfwl_themebackground.h"
11 #include "xfa/fwl/core/ifwl_themeprovider.h" 11 #include "xfa/fwl/core/ifwl_themeprovider.h"
12 #include "xfa/fwl/core/ifwl_widget.h" 12 #include "xfa/fwl/core/ifwl_widget.h"
13 #include "xfa/fxgraphics/cfx_color.h" 13 #include "xfa/fxgraphics/cfx_color.h"
14 #include "xfa/fxgraphics/cfx_path.h" 14 #include "xfa/fxgraphics/cfx_path.h"
15 15
16 #define FWL_SCROLL_PawLen 12.5f 16 #define FWL_SCROLL_PawLen 12.5f
17 17
18 CFWL_ScrollBarTP::CFWL_ScrollBarTP() { 18 CFWL_ScrollBarTP::CFWL_ScrollBarTP() : m_pThemeData(new SBThemeData) {
19 m_pThemeData = new SBThemeData;
20 SetThemeData(0); 19 SetThemeData(0);
21 } 20 }
21
22 CFWL_ScrollBarTP::~CFWL_ScrollBarTP() { 22 CFWL_ScrollBarTP::~CFWL_ScrollBarTP() {
23 if (m_pThemeData) { 23 delete m_pThemeData;
24 delete m_pThemeData;
25 m_pThemeData = NULL;
26 }
27 } 24 }
25
28 FX_BOOL CFWL_ScrollBarTP::IsValidWidget(IFWL_Widget* pWidget) { 26 FX_BOOL CFWL_ScrollBarTP::IsValidWidget(IFWL_Widget* pWidget) {
29 if (!pWidget) 27 if (!pWidget)
30 return FALSE; 28 return FALSE;
31 return pWidget->GetClassID() == FWL_CLASSHASH_ScrollBar; 29 return pWidget->GetClassID() == FWL_CLASSHASH_ScrollBar;
32 } 30 }
33 void* CFWL_ScrollBarTP::GetCapacity(CFWL_ThemePart* pThemePart, 31 void* CFWL_ScrollBarTP::GetCapacity(CFWL_ThemePart* pThemePart,
34 CFWL_WidgetCapacity dwCapacity) { 32 CFWL_WidgetCapacity dwCapacity) {
35 if (dwCapacity == CFWL_WidgetCapacity::Size) { 33 if (dwCapacity == CFWL_WidgetCapacity::Size) {
36 m_fValue = 5; 34 m_fValue = 5;
37 return &m_fValue; 35 return &m_fValue;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); 302 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254);
305 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); 303 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253);
306 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); 304 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216);
307 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); 305 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245);
308 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); 306 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249);
309 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); 307 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211);
310 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); 308 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236);
311 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); 309 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251);
312 } 310 }
313 } 311 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/cfwl_pushbuttontp.cpp ('k') | xfa/fwl/theme/cfwl_widgettp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698