| 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/cfwl_listbox.h" | 7 #include "xfa/fwl/cfwl_listbox.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_dwStates : 0; | 1033 return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_dwStates : 0; |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 void CFWL_ListBox::GetItemRect(CFWL_Widget* pWidget, | 1036 void CFWL_ListBox::GetItemRect(CFWL_Widget* pWidget, |
| 1037 CFWL_ListItem* pItem, | 1037 CFWL_ListItem* pItem, |
| 1038 CFX_RectF& rtItem) { | 1038 CFX_RectF& rtItem) { |
| 1039 if (pItem) | 1039 if (pItem) |
| 1040 rtItem = static_cast<CFWL_ListItem*>(pItem)->m_rtItem; | 1040 rtItem = static_cast<CFWL_ListItem*>(pItem)->m_rtItem; |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 void* CFWL_ListBox::GetItemData(CFWL_Widget* pWidget, CFWL_ListItem* pItem) { | |
| 1044 return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_pData : nullptr; | |
| 1045 } | |
| 1046 | |
| 1047 void CFWL_ListBox::SetItemStyles(CFWL_Widget* pWidget, | 1043 void CFWL_ListBox::SetItemStyles(CFWL_Widget* pWidget, |
| 1048 CFWL_ListItem* pItem, | 1044 CFWL_ListItem* pItem, |
| 1049 uint32_t dwStyle) { | 1045 uint32_t dwStyle) { |
| 1050 if (pItem) | 1046 if (pItem) |
| 1051 static_cast<CFWL_ListItem*>(pItem)->m_dwStates = dwStyle; | 1047 static_cast<CFWL_ListItem*>(pItem)->m_dwStates = dwStyle; |
| 1052 } | 1048 } |
| 1053 | 1049 |
| 1054 void CFWL_ListBox::SetItemRect(CFWL_Widget* pWidget, | 1050 void CFWL_ListBox::SetItemRect(CFWL_Widget* pWidget, |
| 1055 CFWL_ListItem* pItem, | 1051 CFWL_ListItem* pItem, |
| 1056 const CFX_RectF& rtItem) { | 1052 const CFX_RectF& rtItem) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 | 1117 |
| 1122 void CFWL_ListBox::DeleteAll() { | 1118 void CFWL_ListBox::DeleteAll() { |
| 1123 m_ItemArray.clear(); | 1119 m_ItemArray.clear(); |
| 1124 } | 1120 } |
| 1125 | 1121 |
| 1126 uint32_t CFWL_ListBox::GetItemStates(CFWL_ListItem* pItem) { | 1122 uint32_t CFWL_ListBox::GetItemStates(CFWL_ListItem* pItem) { |
| 1127 if (!pItem) | 1123 if (!pItem) |
| 1128 return 0; | 1124 return 0; |
| 1129 return pItem->m_dwStates | pItem->m_dwCheckState; | 1125 return pItem->m_dwStates | pItem->m_dwCheckState; |
| 1130 } | 1126 } |
| OLD | NEW |