mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cleanup: use correct loop bounds
I'm a bit confused why this enum has two extra values, NUM_DIVEMODE and UNDEF_COMP_TYPE. I can see how this could create confusion. This may benefit from addition review. Found by Coverity. Fixes CID 350092. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
56e8ac0bd7
commit
70737b9eec
1 changed files with 1 additions and 1 deletions
|
@ -1652,7 +1652,7 @@ void ProfileWidget2::addDivemodeSwitch()
|
||||||
int i;
|
int i;
|
||||||
QAction *action = qobject_cast<QAction *>(sender());
|
QAction *action = qobject_cast<QAction *>(sender());
|
||||||
QPointF scenePos = mapToScene(mapFromGlobal(action->data().toPoint()));
|
QPointF scenePos = mapToScene(mapFromGlobal(action->data().toPoint()));
|
||||||
for (i = 0; i < UNDEF_COMP_TYPE; i++)
|
for (i = 0; i < NUM_DIVEMODE; i++)
|
||||||
if (gettextFromC::tr(divemode_text_ui[i]) == action->text())
|
if (gettextFromC::tr(divemode_text_ui[i]) == action->text())
|
||||||
add_event(current_dc, lrint(timeAxis->valueAt(scenePos)), 8, 0, i,
|
add_event(current_dc, lrint(timeAxis->valueAt(scenePos)), 8, 0, i,
|
||||||
QT_TRANSLATE_NOOP("gettextFromC", "modechange"));
|
QT_TRANSLATE_NOOP("gettextFromC", "modechange"));
|
||||||
|
|
Loading…
Reference in a new issue