From c32e71e64d97016d201aea26f0623de6cd65d74d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 6 Oct 2018 09:21:27 +0200 Subject: Dive information: fix surface interval calculation The old surface interval calculation had fundamental issues: 1) process_all_dives(), which calculates the statistics over *all* dives was used to get the pointer to the previous dive. 2) If two dives in the table had the same time, one of those would have been considered the "previous" dive. 3) If the dive, for which the surface interval is calculated is not yet in the table, no previous dive would be determined. Fix all this by creating a get_surface_interval() function and removing the "get previous dive" functionality of process_all_dives(). Remove the process_all_dives() call from TabDiveInformation::updateData(). Reported-by: Jan Mulder Signed-off-by: Berthold Stoeger --- export-html.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'export-html.cpp') diff --git a/export-html.cpp b/export-html.cpp index f66bd6909..fecbb5235 100644 --- a/export-html.cpp +++ b/export-html.cpp @@ -54,11 +54,7 @@ int main(int argc, char **argv) prefs.units = git_prefs.units; // populate the statistics - struct dive *d = get_dive(0); - struct dive *pd; - if (d) { - process_all_dives(d, &pd); - } + process_all_dives(); // now set up the export settings to create the HTML export struct htmlExportSetting hes; -- cgit v1.2.3-70-g09d2