| 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/core/cfwl_listbox.h" | 7 #include "xfa/fwl/core/cfwl_listbox.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return nullptr; | 92 return nullptr; |
| 93 return m_ItemArray[nIndex].get(); | 93 return m_ItemArray[nIndex].get(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 uint32_t CFWL_ListBox::GetItemStates(CFWL_ListItem* pItem) { | 96 uint32_t CFWL_ListBox::GetItemStates(CFWL_ListItem* pItem) { |
| 97 if (!pItem) | 97 if (!pItem) |
| 98 return 0; | 98 return 0; |
| 99 return pItem->m_dwStates | pItem->m_dwCheckState; | 99 return pItem->m_dwStates | pItem->m_dwCheckState; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CFWL_ListBox::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) { | |
| 103 wsCaption = L""; | |
| 104 } | |
| 105 | |
| 106 int32_t CFWL_ListBox::CountItems(const IFWL_Widget* pWidget) const { | 102 int32_t CFWL_ListBox::CountItems(const IFWL_Widget* pWidget) const { |
| 107 return pdfium::CollectionSize<int32_t>(m_ItemArray); | 103 return pdfium::CollectionSize<int32_t>(m_ItemArray); |
| 108 } | 104 } |
| 109 | 105 |
| 110 CFWL_ListItem* CFWL_ListBox::GetItem(const IFWL_Widget* pWidget, | 106 CFWL_ListItem* CFWL_ListBox::GetItem(const IFWL_Widget* pWidget, |
| 111 int32_t nIndex) const { | 107 int32_t nIndex) const { |
| 112 if (nIndex < 0 || nIndex >= CountItems(pWidget)) | 108 if (nIndex < 0 || nIndex >= CountItems(pWidget)) |
| 113 return nullptr; | 109 return nullptr; |
| 114 return m_ItemArray[nIndex].get(); | 110 return m_ItemArray[nIndex].get(); |
| 115 } | 111 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 uint32_t CFWL_ListBox::GetItemCheckState(IFWL_Widget* pWidget, | 176 uint32_t CFWL_ListBox::GetItemCheckState(IFWL_Widget* pWidget, |
| 181 CFWL_ListItem* pItem) { | 177 CFWL_ListItem* pItem) { |
| 182 return static_cast<CFWL_ListItem*>(pItem)->m_dwCheckState; | 178 return static_cast<CFWL_ListItem*>(pItem)->m_dwCheckState; |
| 183 } | 179 } |
| 184 | 180 |
| 185 void CFWL_ListBox::SetItemCheckState(IFWL_Widget* pWidget, | 181 void CFWL_ListBox::SetItemCheckState(IFWL_Widget* pWidget, |
| 186 CFWL_ListItem* pItem, | 182 CFWL_ListItem* pItem, |
| 187 uint32_t dwCheckState) { | 183 uint32_t dwCheckState) { |
| 188 static_cast<CFWL_ListItem*>(pItem)->m_dwCheckState = dwCheckState; | 184 static_cast<CFWL_ListItem*>(pItem)->m_dwCheckState = dwCheckState; |
| 189 } | 185 } |
| OLD | NEW |