summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_listbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-16 07:32:48 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-16 07:32:48 -0800
commit92549cd7502296328aecef23dab6d7fc0e847645 (patch)
treea210fab53a0c4b8434c8bd43b288c1b15608b305 /xfa/fwl/core/cfwl_listbox.cpp
parent72f957a0bafaf7c9628980e404c471b54f42de8f (diff)
downloadpdfium-92549cd7502296328aecef23dab6d7fc0e847645.tar.xz
Continue nit cleanup in fwl/core
Review-Url: https://codereview.chromium.org/2506493003
Diffstat (limited to 'xfa/fwl/core/cfwl_listbox.cpp')
-rw-r--r--xfa/fwl/core/cfwl_listbox.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index c5bf881074..5b2ad5efbd 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));