summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_combobox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-16 07:01:26 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-16 07:01:26 -0800
commit72f957a0bafaf7c9628980e404c471b54f42de8f (patch)
tree1b6764bfdb0f87c01843397f16f191906d6810ec /xfa/fwl/core/cfwl_combobox.cpp
parentf35650c8778522345d8a639f42add2874ffe44dd (diff)
downloadpdfium-72f957a0bafaf7c9628980e404c471b54f42de8f.tar.xz
Cleaning up nits in fwl/core files.chromium/2922
This Cl cleans up the nits in the first set of cfwl_* files. The unused Event and Message classes are removed. Review-Url: https://codereview.chromium.org/2505703003
Diffstat (limited to 'xfa/fwl/core/cfwl_combobox.cpp')
-rw-r--r--xfa/fwl/core/cfwl_combobox.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp
index d1f95035d6..a8211e9773 100644
--- a/xfa/fwl/core/cfwl_combobox.cpp
+++ b/xfa/fwl/core/cfwl_combobox.cpp
@@ -47,9 +47,9 @@ int32_t CFWL_ComboBox::AddString(const CFX_WideStringC& wsText) {
}
bool CFWL_ComboBox::RemoveAt(int32_t iIndex) {
- if (iIndex < 0 || static_cast<size_t>(iIndex) >= m_ItemArray.size()) {
+ if (iIndex < 0 || static_cast<size_t>(iIndex) >= m_ItemArray.size())
return false;
- }
+
m_ItemArray.erase(m_ItemArray.begin() + iIndex);
return true;
}
@@ -167,7 +167,6 @@ CFWL_ListItem* CFWL_ComboBox::GetItem(const IFWL_Widget* pWidget,
int32_t nIndex) const {
if (nIndex < 0 || static_cast<size_t>(nIndex) >= m_ItemArray.size())
return nullptr;
-
return m_ItemArray[nIndex].get();
}
@@ -183,9 +182,7 @@ int32_t CFWL_ComboBox::GetItemIndex(IFWL_Widget* pWidget,
uint32_t CFWL_ComboBox::GetItemStyles(IFWL_Widget* pWidget,
CFWL_ListItem* pItem) {
- if (!pItem)
- return 0;
- return static_cast<CFWL_ListItem*>(pItem)->m_dwStyles;
+ return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_dwStyles : 0;
}
void CFWL_ComboBox::GetItemText(IFWL_Widget* pWidget,
@@ -200,6 +197,7 @@ void CFWL_ComboBox::GetItemRect(IFWL_Widget* pWidget,
CFX_RectF& rtItem) {
if (!pItem)
return;
+
CFWL_ListItem* pComboItem = static_cast<CFWL_ListItem*>(pItem);
rtItem.Set(pComboItem->m_rtItem.left, pComboItem->m_rtItem.top,
pComboItem->m_rtItem.width, pComboItem->m_rtItem.height);