Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: xfa/src/fwl/src/lightwidget/combobox.cpp

Issue 1671213002: Fix build broken at e059b5ba1260 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fwl/src/lightwidget/combobox.cpp
diff --git a/xfa/src/fwl/src/lightwidget/combobox.cpp b/xfa/src/fwl/src/lightwidget/combobox.cpp
index 07556b7797f486a7a479ec21b04ad3d8af27e30b..e6c0160b34d604afd0466a83801f0367a7c4c95d 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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698