From 999a63a5bba58d39a23da34b0eddc37324298699 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 27 Jul 2019 16:44:24 +0200 Subject: [PATCH] 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 --- desktop-widgets/tab-widgets/maintab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;