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

Side by Side Diff: xfa/fwl/lightwidget/cfwl_listbox.cpp

Issue 2422303003: Remove FWL Create methods, use new instead (Closed)
Patch Set: Created 4 years, 2 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
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/lightwidget/cfwl_listbox.h" 7 #include "xfa/fwl/lightwidget/cfwl_listbox.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "third_party/base/stl_util.h" 11 #include "third_party/base/stl_util.h"
12 12
13 IFWL_ListBox* CFWL_ListBox::GetWidget() { 13 IFWL_ListBox* CFWL_ListBox::GetWidget() {
14 return static_cast<IFWL_ListBox*>(m_pIface.get()); 14 return static_cast<IFWL_ListBox*>(m_pIface.get());
15 } 15 }
16 16
17 const IFWL_ListBox* CFWL_ListBox::GetWidget() const { 17 const IFWL_ListBox* CFWL_ListBox::GetWidget() const {
18 return static_cast<IFWL_ListBox*>(m_pIface.get()); 18 return static_cast<IFWL_ListBox*>(m_pIface.get());
19 } 19 }
20 20
21 CFWL_ListBox* CFWL_ListBox::Create() {
22 return new CFWL_ListBox;
23 }
24
25 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { 21 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) {
26 if (m_pIface) 22 if (m_pIface)
27 return FWL_Error::Indefinite; 23 return FWL_Error::Indefinite;
28 if (pProperties) { 24 if (pProperties) {
29 *m_pProperties = *pProperties; 25 *m_pProperties = *pProperties;
30 } 26 }
31 std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create( 27 std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create(
32 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); 28 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr));
33 FWL_Error ret = pListBox->Initialize(); 29 FWL_Error ret = pListBox->Initialize();
34 if (ret != FWL_Error::Succeeded) { 30 if (ret != FWL_Error::Succeeded) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 m_rtItem.Reset(); 346 m_rtItem.Reset();
351 m_dwStates = 0; 347 m_dwStates = 0;
352 m_wsText = L""; 348 m_wsText = L"";
353 m_pDIB = nullptr; 349 m_pDIB = nullptr;
354 m_pData = nullptr; 350 m_pData = nullptr;
355 m_dwCheckState = 0; 351 m_dwCheckState = 0;
356 m_rtCheckBox.Reset(); 352 m_rtCheckBox.Reset();
357 } 353 }
358 354
359 CFWL_ListItem::~CFWL_ListItem() {} 355 CFWL_ListItem::~CFWL_ListItem() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698