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

Unified Diff: xfa/fwl/core/ifwl_listbox.cpp

Issue 2464703006: Fold IFWL*::{Initialize|Finalize} into constructor/destructor (Closed)
Patch Set: Rebase to master Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.h ('k') | xfa/fwl/core/ifwl_monthcalendar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_listbox.cpp
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index 7cd4c53ff313067692173801556cbb32b28fbdda..b4b6c251363ee986b6b81abf6ba33e27d1c5a2bd 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -6,6 +6,7 @@
#include "xfa/fwl/core/ifwl_listbox.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fde/tto/fde_textout.h"
#include "xfa/fwl/core/cfwl_message.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
@@ -33,25 +34,11 @@ IFWL_ListBox::IFWL_ListBox(const IFWL_App* app,
m_rtClient.Reset();
m_rtConent.Reset();
m_rtStatic.Reset();
-}
-
-IFWL_ListBox::~IFWL_ListBox() {}
-void IFWL_ListBox::Initialize() {
- IFWL_Widget::Initialize();
- m_pDelegate = new CFWL_ListBoxImpDelegate(this);
+ SetDelegate(pdfium::MakeUnique<CFWL_ListBoxImpDelegate>(this));
}
-void IFWL_ListBox::Finalize() {
- if (m_pVertScrollBar)
- m_pVertScrollBar->Finalize();
- if (m_pHorzScrollBar)
- m_pHorzScrollBar->Finalize();
-
- delete m_pDelegate;
- m_pDelegate = nullptr;
- IFWL_Widget::Finalize();
-}
+IFWL_ListBox::~IFWL_ListBox() {}
FWL_Type IFWL_ListBox::GetClassID() const {
return FWL_Type::ListBox;
@@ -896,9 +883,8 @@ void IFWL_ListBox::InitScrollBar(FX_BOOL bVert) {
prop.m_dwStates = FWL_WGTSTATE_Invisible;
prop.m_pParent = this;
prop.m_pThemeProvider = m_pScrollBarTP;
- IFWL_ScrollBar* pScrollBar = new IFWL_ScrollBar(m_pOwnerApp, prop, this);
- pScrollBar->Initialize();
- (bVert ? &m_pVertScrollBar : &m_pHorzScrollBar)->reset(pScrollBar);
+ (bVert ? &m_pVertScrollBar : &m_pHorzScrollBar)
+ ->reset(new IFWL_ScrollBar(m_pOwnerApp, prop, this));
}
FX_BOOL IFWL_ListBox::IsShowScrollBar(FX_BOOL bVert) {
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.h ('k') | xfa/fwl/core/ifwl_monthcalendar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698