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

Side by Side Diff: xfa/fwl/basewidget/fwl_pushbuttonimp.cpp

Issue 2095653002: Remove NULL in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 5 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/basewidget/fwl_pushbuttonimp.h ('k') | xfa/fwl/basewidget/fwl_scrollbarimp.h » ('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/basewidget/fwl_pushbuttonimp.h" 7 #include "xfa/fwl/basewidget/fwl_pushbuttonimp.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_pushbutton.h" 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 FWL_Error CFWL_PushButtonImp::Finalize() { 61 FWL_Error CFWL_PushButtonImp::Finalize() {
62 delete m_pDelegate; 62 delete m_pDelegate;
63 m_pDelegate = nullptr; 63 m_pDelegate = nullptr;
64 return CFWL_WidgetImp::Finalize(); 64 return CFWL_WidgetImp::Finalize();
65 } 65 }
66 FWL_Error CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, 66 FWL_Error CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect,
67 FX_BOOL bAutoSize) { 67 FX_BOOL bAutoSize) {
68 if (bAutoSize) { 68 if (bAutoSize) {
69 rect.Set(0, 0, 0, 0); 69 rect.Set(0, 0, 0, 0);
70 if (m_pProperties->m_pThemeProvider == NULL) { 70 if (!m_pProperties->m_pThemeProvider) {
71 m_pProperties->m_pThemeProvider = GetAvailableTheme(); 71 m_pProperties->m_pThemeProvider = GetAvailableTheme();
72 } 72 }
73 CFX_WideString wsCaption; 73 CFX_WideString wsCaption;
74 IFWL_PushButtonDP* pData = 74 IFWL_PushButtonDP* pData =
75 static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider); 75 static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
76 if (pData) { 76 if (pData) {
77 pData->GetCaption(m_pInterface, wsCaption); 77 pData->GetCaption(m_pInterface, wsCaption);
78 } 78 }
79 int32_t iLen = wsCaption.GetLength(); 79 int32_t iLen = wsCaption.GetLength();
80 if (iLen > 0) { 80 if (iLen > 0) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return FWL_Error::Succeeded; 115 return FWL_Error::Succeeded;
116 } 116 }
117 FWL_Error CFWL_PushButtonImp::DrawWidget(CFX_Graphics* pGraphics, 117 FWL_Error CFWL_PushButtonImp::DrawWidget(CFX_Graphics* pGraphics,
118 const CFX_Matrix* pMatrix) { 118 const CFX_Matrix* pMatrix) {
119 if (!pGraphics) 119 if (!pGraphics)
120 return FWL_Error::Indefinite; 120 return FWL_Error::Indefinite;
121 if (!m_pProperties->m_pThemeProvider) 121 if (!m_pProperties->m_pThemeProvider)
122 return FWL_Error::Indefinite; 122 return FWL_Error::Indefinite;
123 IFWL_PushButtonDP* pData = 123 IFWL_PushButtonDP* pData =
124 static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider); 124 static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
125 CFX_DIBitmap* pPicture = NULL; 125 CFX_DIBitmap* pPicture = nullptr;
126 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; 126 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
127 if (HasBorder()) { 127 if (HasBorder()) {
128 DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, 128 DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider,
129 pMatrix); 129 pMatrix);
130 } 130 }
131 if (HasEdge()) { 131 if (HasEdge()) {
132 DrawEdge(pGraphics, CFWL_Part::Edge, m_pProperties->m_pThemeProvider, 132 DrawEdge(pGraphics, CFWL_Part::Edge, m_pProperties->m_pThemeProvider,
133 pMatrix); 133 pMatrix);
134 } 134 }
135 DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix); 135 DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix);
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 CFWL_EvtClick wmClick; 555 CFWL_EvtClick wmClick;
556 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; 556 wmClick.m_pSrcTarget = m_pOwner->m_pInterface;
557 m_pOwner->DispatchEvent(&wmClick); 557 m_pOwner->DispatchEvent(&wmClick);
558 return; 558 return;
559 } 559 }
560 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { 560 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) {
561 return; 561 return;
562 } 562 }
563 m_pOwner->DispatchKeyEvent(pMsg); 563 m_pOwner->DispatchKeyEvent(pMsg);
564 } 564 }
OLDNEW
« no previous file with comments | « xfa/fwl/basewidget/fwl_pushbuttonimp.h ('k') | xfa/fwl/basewidget/fwl_scrollbarimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698