summaryrefslogtreecommitdiff
path: root/src/gui/widgets/setupitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/setupitem.cpp')
-rw-r--r--src/gui/widgets/setupitem.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 8be4696e1..8be7dd520 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -895,9 +895,15 @@ void SetupItemSlider2::updateLabel()
{
int val = static_cast<int>(mSlider->getValue()) - mMin;
if (val < 0)
+ {
val = 0;
- else if (val >= static_cast<signed>(mValues->size()))
- val = static_cast<signed>(mValues->size()) - 1;
+ }
+ else
+ {
+ const int sz = static_cast<signed>(mValues->size());
+ if (val >= sz)
+ val = sz - 1;
+ }
std::string str = mValues->at(val);
mLabel2->setCaption(str);
}