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

Unified Diff: xfa/fwl/core/cfwl_listbox.cpp

Issue 2506493003: Continue nit cleanup in fwl/core (Closed)
Patch Set: review feedback Created 4 years, 1 month 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 | « xfa/fwl/core/cfwl_edit.cpp ('k') | xfa/fwl/core/cfwl_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/cfwl_listbox.cpp
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index c5bf88107467fb4ccba6bdd740f3bc1d1858ea70..5b2ad5efbdc6428e88400059f22cb66ed4b7eaa0 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -47,13 +47,9 @@ bool CFWL_ListBox::DeleteString(CFWL_ListItem* pItem) {
if (nIndex < 0 || static_cast<size_t>(nIndex) >= m_ItemArray.size())
return false;
- int32_t iCount = CountItems(m_pIface.get());
int32_t iSel = nIndex + 1;
- if (iSel >= iCount) {
+ if (iSel >= CountItems(m_pIface.get()))
iSel = nIndex - 1;
- if (iSel < 0)
- iSel = -1;
- }
if (iSel >= 0) {
CFWL_ListItem* pSel =
static_cast<CFWL_ListItem*>(GetItem(m_pIface.get(), iSel));
« no previous file with comments | « xfa/fwl/core/cfwl_edit.cpp ('k') | xfa/fwl/core/cfwl_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698