summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-04 09:55:07 +0200
committerNoel Grandin <noel@peralex.com>2014-12-04 13:27:25 +0200
commite5ed703b833d881b05a71808a5fc2f51903fd1c0 (patch)
tree058180e5d2de3e48972f5c01ef9765e59a411c07 /vcl
parent12491e11f05b56130e33ab6ed637cf1fe01ca9fc (diff)
the return code COMBOBOX_ERROR is completely ignored
so let's turn it into an assert, since these failures are pretty fatal anyhow Change-Id: Idfb499e3b09f1c5413fae8a0961d968a0694beed
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/combobox.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index d35a64bf3006..fca17160338a 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -845,8 +845,7 @@ void ComboBox::ImplUpdateFloatSelection()
sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos)
{
- if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= mpImplLB->GetEntryList()->GetEntryCount())
- return COMBOBOX_ERROR;
+ assert(nPos >= 0 && COMBOBOX_MAX_ENTRIES > mpImplLB->GetEntryList()->GetEntryCount());
sal_Int32 nRealPos;
if (nPos == COMBOBOX_APPEND)
@@ -854,8 +853,7 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos)
else
{
const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
- if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
- return COMBOBOX_ERROR;
+ assert(nPos <= COMBOBOX_MAX_ENTRIES - nMRUCount);
nRealPos = nPos + nMRUCount;
}
@@ -868,8 +866,7 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos)
sal_Int32 ComboBox::InsertEntryWithImage(
const OUString& rStr, const Image& rImage, sal_Int32 const nPos)
{
- if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= mpImplLB->GetEntryList()->GetEntryCount())
- return COMBOBOX_ERROR;
+ assert(nPos >= 0 & COMBOBOX_MAX_ENTRIES > mpImplLB->GetEntryList()->GetEntryCount());
sal_Int32 nRealPos;
if (nPos == COMBOBOX_APPEND)
@@ -877,8 +874,7 @@ sal_Int32 ComboBox::InsertEntryWithImage(
else
{
const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
- if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
- return COMBOBOX_ERROR;
+ assert(nPos <= COMBOBOX_MAX_ENTRIES - nMRUCount);
nRealPos = nPos + nMRUCount;
}