Choice issue when the first item is not available

This commit is contained in:
Bertrand Songis
2020-06-02 23:39:31 +02:00
parent baf7b199a2
commit 514612f271
+3 -3
View File
@@ -102,14 +102,14 @@ class Choice : public ChoiceBase {
return index; return index;
} }
int getValueFromIndex(unsigned index) int getValueFromIndex(int index)
{ {
if (!isValueAvailable) { if (!isValueAvailable) {
return vmin + index; return vmin + index;
} }
int value = vmin; int value = vmin - 1;
while (index > 0) { while (index >= 0) {
index--; index--;
value++; value++;
while (value < vmax && !isValueAvailable(value)) { while (value < vmax && !isValueAvailable(value)) {