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

Side by Side Diff: xfa/fwl/core/fwl_widgetimp.cpp

Issue 2207093005: Use smart pointers for class owned pointers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: small fix Created 4 years, 4 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
« xfa/fwl/core/fwl_noteimp.cpp ('K') | « xfa/fwl/core/fwl_widgetimp.h ('k') | no next file » | 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/core/fwl_widgetimp.h" 7 #include "xfa/fwl/core/fwl_widgetimp.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 void* CFWL_WidgetImp::GetAssociateWidget() const { 524 void* CFWL_WidgetImp::GetAssociateWidget() const {
525 return m_pAssociate; 525 return m_pAssociate;
526 } 526 }
527 527
528 void CFWL_WidgetImp::SetAssociateWidget(void* pAssociate) { 528 void CFWL_WidgetImp::SetAssociateWidget(void* pAssociate) {
529 m_pAssociate = pAssociate; 529 m_pAssociate = pAssociate;
530 } 530 }
531 531
532 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, 532 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
533 IFWL_Widget* pOuter) 533 IFWL_Widget* pOuter)
534 : m_pProperties(new CFWL_WidgetImpProperties), 534 : m_pProperties(new CFWL_WidgetImpProperties(properties)),
535 m_pDelegate(nullptr), 535 m_pDelegate(nullptr),
536 m_pCurDelegate(nullptr), 536 m_pCurDelegate(nullptr),
537 m_pOuter(pOuter), 537 m_pOuter(pOuter),
538 m_pInterface(nullptr), 538 m_pInterface(nullptr),
539 m_pLayoutItem(nullptr), 539 m_pLayoutItem(nullptr),
540 m_pAssociate(nullptr), 540 m_pAssociate(nullptr),
541 m_iLock(0), 541 m_iLock(0),
542 m_nEventKey(0) { 542 m_nEventKey(0) {
543 *m_pProperties = properties;
544 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance(); 543 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance();
Lei Zhang 2016/08/04 18:49:31 Can this also go on the initializer list?
Wei Li 2016/08/04 22:16:04 Done.
545 ASSERT(m_pWidgetMgr); 544 ASSERT(m_pWidgetMgr);
546 } 545 }
547 546
548 CFWL_WidgetImp::~CFWL_WidgetImp() { 547 CFWL_WidgetImp::~CFWL_WidgetImp() {}
549 delete m_pProperties;
550 }
551 548
552 FX_BOOL CFWL_WidgetImp::IsEnabled() const { 549 FX_BOOL CFWL_WidgetImp::IsEnabled() const {
553 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; 550 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0;
554 } 551 }
555 FX_BOOL CFWL_WidgetImp::IsVisible() const { 552 FX_BOOL CFWL_WidgetImp::IsVisible() const {
556 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; 553 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0;
557 } 554 }
558 FX_BOOL CFWL_WidgetImp::IsActive() const { 555 FX_BOOL CFWL_WidgetImp::IsActive() const {
559 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0; 556 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0;
560 } 557 }
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 } 1040 }
1044 } 1041 }
1045 1042
1046 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} 1043 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {}
1047 1044
1048 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, 1045 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
1049 const CFX_Matrix* pMatrix) { 1046 const CFX_Matrix* pMatrix) {
1050 CFWL_EvtDraw evt; 1047 CFWL_EvtDraw evt;
1051 evt.m_pGraphics = pGraphics; 1048 evt.m_pGraphics = pGraphics;
1052 } 1049 }
OLDNEW
« xfa/fwl/core/fwl_noteimp.cpp ('K') | « xfa/fwl/core/fwl_widgetimp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698