OLD | NEW |
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 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { | 21 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { |
22 if (m_pIface) | 22 if (m_pIface) |
23 return FWL_Error::Indefinite; | 23 return FWL_Error::Indefinite; |
24 if (pProperties) { | 24 if (pProperties) { |
25 *m_pProperties = *pProperties; | 25 *m_pProperties = *pProperties; |
26 } | 26 } |
27 std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create( | 27 std::unique_ptr<IFWL_ListBox> pListBox(new IFWL_ListBox( |
28 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); | 28 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); |
29 FWL_Error ret = pListBox->Initialize(); | 29 FWL_Error ret = pListBox->Initialize(); |
30 if (ret != FWL_Error::Succeeded) { | 30 if (ret != FWL_Error::Succeeded) { |
31 return ret; | 31 return ret; |
32 } | 32 } |
33 m_pIface = std::move(pListBox); | 33 m_pIface = std::move(pListBox); |
34 CFWL_Widget::Initialize(); | 34 CFWL_Widget::Initialize(); |
35 return FWL_Error::Succeeded; | 35 return FWL_Error::Succeeded; |
36 } | 36 } |
37 | 37 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 m_rtItem.Reset(); | 346 m_rtItem.Reset(); |
347 m_dwStates = 0; | 347 m_dwStates = 0; |
348 m_wsText = L""; | 348 m_wsText = L""; |
349 m_pDIB = nullptr; | 349 m_pDIB = nullptr; |
350 m_pData = nullptr; | 350 m_pData = nullptr; |
351 m_dwCheckState = 0; | 351 m_dwCheckState = 0; |
352 m_rtCheckBox.Reset(); | 352 m_rtCheckBox.Reset(); |
353 } | 353 } |
354 | 354 |
355 CFWL_ListItem::~CFWL_ListItem() {} | 355 CFWL_ListItem::~CFWL_ListItem() {} |
OLD | NEW |