]> git.tdb.fi Git - ext/subsurface.git/blobdiff - parse-xml.c
Fix up dive number naming
[ext/subsurface.git] / parse-xml.c
index 92da468f44a2f946bdada7e310a924f6141e931b..b5f86fa8043c3d26c63e0d1537a3cbf809d97aab 100644 (file)
@@ -876,6 +876,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
                break;
        }
 
+       if (MATCH(".number", get_index, &dive->number))
+               return;
        if (MATCH(".date", divedate, &dive->when))
                return;
        if (MATCH(".time", divetime, &dive->when))
@@ -1053,11 +1055,12 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
        /* Ok, we have both size and pressure: try to match a description */
        match_standard_cylinder(type);
 
-       /* .. and let's assume that the 'size' was cu ft of air */
-       volume_of_air = type->size.mliter * 28.317;     /* milli-cu ft to milliliter */
-       atm = type->workingpressure.mbar / 1013.25;     /* working pressure in atm */
-       volume = volume_of_air / atm;                   /* milliliters at 1 atm: "true size" */
-       type->size.mliter = volume + 0.5;
+       if (input_units.volume == CUFT || import_source == SUUNTO) {
+               volume_of_air = type->size.mliter * 28.317;     /* milli-cu ft to milliliter */
+               atm = type->workingpressure.mbar / 1013.25;     /* working pressure in atm */
+               volume = volume_of_air / atm;                   /* milliliters at 1 atm: "true size" */
+               type->size.mliter = volume + 0.5;
+       }
 }
 
 static void sanitize_cylinder_info(struct dive *dive)