Chromium Code Reviews| 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_combobox.h" | 7 #include "xfa/fwl/lightwidget/cfwl_combobox.h" | 
| 8 | 8 | 
| 9 #include <utility> | 9 #include <utility> | 
| 10 | 10 | 
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 if (!pItem) | 163 if (!pItem) | 
| 164 return FWL_Error::Indefinite; | 164 return FWL_Error::Indefinite; | 
| 165 pItem->m_pData = pData; | 165 pItem->m_pData = pData; | 
| 166 return FWL_Error::Succeeded; | 166 return FWL_Error::Succeeded; | 
| 167 } | 167 } | 
| 168 | 168 | 
| 169 void* CFWL_ComboBox::GetItemData(int32_t iIndex) { | 169 void* CFWL_ComboBox::GetItemData(int32_t iIndex) { | 
| 170 CFWL_ComboBoxItem* pItem = | 170 CFWL_ComboBoxItem* pItem = | 
| 171 static_cast<CFWL_ComboBoxItem*>(m_comboBoxData.GetItem(m_pIface, iIndex)); | 171 static_cast<CFWL_ComboBoxItem*>(m_comboBoxData.GetItem(m_pIface, iIndex)); | 
| 172 if (!pItem) | 172 if (!pItem) | 
| 173 return NULL; | 173 return nullptr; | 
| 174 return pItem->m_pData; | 174 return pItem->m_pData; | 
| 
 
Lei Zhang
2016/06/23 18:21:44
ternary
 
dsinclair
2016/06/23 18:46:53
Done.
 
 | |
| 175 } | 175 } | 
| 176 | 176 | 
| 177 FWL_Error CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) { | 177 FWL_Error CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) { | 
| 178 return static_cast<IFWL_ComboBox*>(m_pIface)->GetListBoxt()->SetThemeProvider( | 178 return static_cast<IFWL_ComboBox*>(m_pIface)->GetListBoxt()->SetThemeProvider( | 
| 179 pTheme); | 179 pTheme); | 
| 180 } | 180 } | 
| 181 | 181 | 
| 182 FX_BOOL CFWL_ComboBox::AfterFocusShowDropList() { | 182 FX_BOOL CFWL_ComboBox::AfterFocusShowDropList() { | 
| 183 return static_cast<IFWL_ComboBox*>(m_pIface)->AfterFocusShowDropList(); | 183 return static_cast<IFWL_ComboBox*>(m_pIface)->AfterFocusShowDropList(); | 
| 184 } | 184 } | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 351 return FWL_Error::Indefinite; | 351 return FWL_Error::Indefinite; | 
| 352 CFWL_ComboBoxItem* pComboItem = static_cast<CFWL_ComboBoxItem*>(pItem); | 352 CFWL_ComboBoxItem* pComboItem = static_cast<CFWL_ComboBoxItem*>(pItem); | 
| 353 rtItem.Set(pComboItem->m_rtItem.left, pComboItem->m_rtItem.top, | 353 rtItem.Set(pComboItem->m_rtItem.left, pComboItem->m_rtItem.top, | 
| 354 pComboItem->m_rtItem.width, pComboItem->m_rtItem.height); | 354 pComboItem->m_rtItem.width, pComboItem->m_rtItem.height); | 
| 355 return FWL_Error::Succeeded; | 355 return FWL_Error::Succeeded; | 
| 356 } | 356 } | 
| 357 | 357 | 
| 358 void* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemData(IFWL_Widget* pWidget, | 358 void* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemData(IFWL_Widget* pWidget, | 
| 359 IFWL_ListItem* pItem) { | 359 IFWL_ListItem* pItem) { | 
| 360 if (!pItem) | 360 if (!pItem) | 
| 361 return NULL; | 361 return nullptr; | 
| 362 return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pData; | 362 return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pData; | 
| 
 
Lei Zhang
2016/06/23 18:21:44
ternary
 
dsinclair
2016/06/23 18:46:53
Done.
 
 | |
| 363 } | 363 } | 
| 364 | 364 | 
| 365 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemStyles(IFWL_Widget* pWidget, | 365 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemStyles(IFWL_Widget* pWidget, | 
| 366 IFWL_ListItem* pItem, | 366 IFWL_ListItem* pItem, | 
| 367 uint32_t dwStyle) { | 367 uint32_t dwStyle) { | 
| 368 if (!pItem) | 368 if (!pItem) | 
| 369 return FWL_Error::Indefinite; | 369 return FWL_Error::Indefinite; | 
| 370 static_cast<CFWL_ComboBoxItem*>(pItem)->m_dwStyles = dwStyle; | 370 static_cast<CFWL_ComboBoxItem*>(pItem)->m_dwStyles = dwStyle; | 
| 371 return FWL_Error::Succeeded; | 371 return FWL_Error::Succeeded; | 
| 372 } | 372 } | 
| (...skipping 17 matching lines...) Expand all Loading... | |
| 390 } | 390 } | 
| 391 | 391 | 
| 392 FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetItemHeight(IFWL_Widget* pWidget) { | 392 FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetItemHeight(IFWL_Widget* pWidget) { | 
| 393 return m_fItemHeight; | 393 return m_fItemHeight; | 
| 394 } | 394 } | 
| 395 | 395 | 
| 396 CFX_DIBitmap* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIcon( | 396 CFX_DIBitmap* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIcon( | 
| 397 IFWL_Widget* pWidget, | 397 IFWL_Widget* pWidget, | 
| 398 IFWL_ListItem* pItem) { | 398 IFWL_ListItem* pItem) { | 
| 399 if (!pItem) | 399 if (!pItem) | 
| 400 return NULL; | 400 return nullptr; | 
| 401 return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pDIB; | 401 return static_cast<CFWL_ComboBoxItem*>(pItem)->m_pDIB; | 
| 
 
Lei Zhang
2016/06/23 18:21:44
ternary
 
dsinclair
2016/06/23 18:46:53
Done.
 
 | |
| 402 } | 402 } | 
| 403 | 403 | 
| 404 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckRect(IFWL_Widget* pWidget, | 404 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckRect(IFWL_Widget* pWidget, | 
| 405 IFWL_ListItem* pItem, | 405 IFWL_ListItem* pItem, | 
| 406 CFX_RectF& rtCheck) { | 406 CFX_RectF& rtCheck) { | 
| 407 rtCheck = static_cast<CFWL_ComboBoxItem*>(pItem)->m_rtCheckBox; | 407 rtCheck = static_cast<CFWL_ComboBoxItem*>(pItem)->m_rtCheckBox; | 
| 408 return FWL_Error::Succeeded; | 408 return FWL_Error::Succeeded; | 
| 409 } | 409 } | 
| 410 | 410 | 
| 411 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckRect( | 411 FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckRect( | 
| (...skipping 18 matching lines...) Expand all Loading... | |
| 430 return FWL_Error::Succeeded; | 430 return FWL_Error::Succeeded; | 
| 431 } | 431 } | 
| 432 | 432 | 
| 433 FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetListHeight(IFWL_Widget* pWidget) { | 433 FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetListHeight(IFWL_Widget* pWidget) { | 
| 434 return m_fMaxListHeight; | 434 return m_fMaxListHeight; | 
| 435 } | 435 } | 
| 436 | 436 | 
| 437 CFWL_ComboBoxItem::CFWL_ComboBoxItem() : m_pDIB(nullptr), m_pData(nullptr) {} | 437 CFWL_ComboBoxItem::CFWL_ComboBoxItem() : m_pDIB(nullptr), m_pData(nullptr) {} | 
| 438 | 438 | 
| 439 CFWL_ComboBoxItem::~CFWL_ComboBoxItem() {} | 439 CFWL_ComboBoxItem::~CFWL_ComboBoxItem() {} | 
| OLD | NEW |