summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-27 16:44:24 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-07-27 11:51:34 -0700
commit999a63a5bba58d39a23da34b0eddc37324298699 (patch)
tree92f4ba53eb1a45d67eb89e7f0efa3e3e1d0ba18e
parent9485ace7098a7b76d9aee9d3eb1f5fc5becc2652 (diff)
downloadsubsurface-999a63a5bba58d39a23da34b0eddc37324298699.tar.gz
Desktop: fix index in weightsystems_equal()
The weightsystem_equal() function compares weightsystems of two dives to decide whether the "commit changes" message should be shown and to decide which dives are edited when changing multiple dives. Due to an index mixup the function returned wrong results for more than two weightsystems. Fix it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 2d31c4536..a6a3f541f 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -674,7 +674,7 @@ bool weightsystems_equal(const dive *d1, const dive *d2)
if (d1->weightsystems.nr != d2->weightsystems.nr)
return false;
for (int i = 0; i < d1->weightsystems.nr; ++i) {
- if (!same_weightsystem(d1->weightsystems.weightsystems[0], d2->weightsystems.weightsystems[i]))
+ if (!same_weightsystem(d1->weightsystems.weightsystems[i], d2->weightsystems.weightsystems[i]))
return false;
}
return true;