summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-05 12:45:58 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-05 12:45:58 -0800
commit9c98adb0404c4b161ceb71953772b79983afa55d (patch)
tree82bcf108ecda8d7625a40e1d81e1fc726c05683d
parente059b5ba126082c0303bb4d46df947f34fcb0e61 (diff)
downloadpdfium-9c98adb0404c4b161ceb71953772b79983afa55d.tar.xz
Fix build broken at e059b5ba1260
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1671213002 .
-rw-r--r--xfa/src/fwl/src/lightwidget/combobox.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/xfa/src/fwl/src/lightwidget/combobox.cpp b/xfa/src/fwl/src/lightwidget/combobox.cpp
index 07556b7797..e6c0160b34 100644
--- a/xfa/src/fwl/src/lightwidget/combobox.cpp
+++ b/xfa/src/fwl/src/lightwidget/combobox.cpp
@@ -44,9 +44,10 @@ int32_t CFWL_ComboBox::AddString(const CFX_WideStringC& wsText,
return m_comboBoxData.m_ItemArray.size() - 1;
}
bool CFWL_ComboBox::RemoveAt(int32_t iIndex) {
- if (iIndex < 0 || iIndex >= m_comboBoxData.m_ItemArray.size())
+ if (iIndex < 0 ||
+ static_cast<size_t>(iIndex) >= m_comboBoxData.m_ItemArray.size()) {
return false;
-
+ }
m_comboBoxData.m_ItemArray.erase(m_comboBoxData.m_ItemArray.begin() + iIndex);
return true;
}
@@ -245,9 +246,10 @@ int32_t CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget* pWidget) {
}
FWL_HLISTITEM CFWL_ComboBox::CFWL_ComboBoxDP::GetItem(IFWL_Widget* pWidget,
int32_t nIndex) {
- return nIndex >= 0 && nIndex < m_ItemArray.size()
- ? reinterpret_cast<FWL_HLISTITEM>(m_ItemArray[nIndex].get())
- : nullptr;
+ if (nIndex < 0 || static_cast<size_t>(nIndex) >= m_ItemArray.size())
+ return nullptr;
+
+ return reinterpret_cast<FWL_HLISTITEM>(m_ItemArray[nIndex].get());
}
int32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem) {
@@ -261,7 +263,7 @@ int32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget* pWidget,
FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
int32_t nIndex) {
- if (nIndex < 0 || nIndex >= m_ItemArray.size())
+ if (nIndex < 0 || static_cast<size_t>(nIndex) >= m_ItemArray.size())
return FALSE;
m_ItemArray[nIndex].reset(reinterpret_cast<CFWL_ComboBoxItem*>(hItem));