From cd38cda186c0fd0849854ae85c012a152ec5ffbc Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sat, 4 Feb 2017 15:52:56 +0100 Subject: Bugfix planner output formating (linebreaks) Changed the markup with
and
tags of the planner output in a way that is is a good compromise for both displaying in UI and printing. Signed-off-by: Stefan Fuchs --- core/planner.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/planner.c b/core/planner.c index ee8809a89..d30b1ea5a 100644 --- a/core/planner.c +++ b/core/planner.c @@ -579,22 +579,22 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool return; } - len = show_disclaimer ? snprintf(buffer, sz_buffer, "
%s

", disclaimer) : 0; + len = show_disclaimer ? snprintf(buffer, sz_buffer, "
%s
", disclaimer) : 0; if (diveplan->surface_interval > 60) { - len += snprintf(buffer + len, sz_buffer - len, "
%s %d:%02d)
", + len += snprintf(buffer + len, sz_buffer - len, "
%s %d:%02d)
", translate("gettextFromC", "Subsurface dive plan (surface interval "), FRACTION(diveplan->surface_interval / 60, 60)); } else { - len += snprintf(buffer + len, sz_buffer - len, "
%s
", + len += snprintf(buffer + len, sz_buffer - len, "
%s
", translate("gettextFromC", "Subsurface dive plan")); } - len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "
Runtime: %dmin

"), + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin
"), diveplan_duration(diveplan)); if (!plan_verbatim) { - len += snprintf(buffer + len, sz_buffer - len, "
", + len += snprintf(buffer + len, sz_buffer - len, "
%s
", translate("gettextFromC", "depth")); if (plan_display_duration) len += snprintf(buffer + len, sz_buffer - len, "", @@ -787,16 +787,16 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool lastentered = dp->entered; } while ((dp = nextdp) != NULL); if (!plan_verbatim) - len += snprintf(buffer + len, sz_buffer - len, "
%s%s
"); + len += snprintf(buffer + len, sz_buffer - len, "
"); /* Print the CNS and OTU next.*/ dive->cns = 0; dive->maxcns = 0; update_cylinder_related_info(dive); snprintf(temp, sz_temp, "%s", translate("gettextFromC", "CNS")); - len += snprintf(buffer + len, sz_buffer - len, "

%s: %i%%", temp, dive->cns); + len += snprintf(buffer + len, sz_buffer - len, "
%s: %i%%", temp, dive->cns); snprintf(temp, sz_temp, "%s", translate("gettextFromC", "OTU")); - len += snprintf(buffer + len, sz_buffer - len, "
%s: %i
", temp, dive->otu); + len += snprintf(buffer + len, sz_buffer - len, "
%s: %i
", temp, dive->otu); /* Print the settings for the diveplan next. */ if (decoMode() == BUEHLMANN){ @@ -816,12 +816,12 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool snprintf(temp, sz_temp, translate("gettextFromC", "Deco model: Recreational mode based on Bühlmann ZHL-16B with GFlow = %d and GFhigh = %d"), diveplan->gflow, diveplan->gfhigh); } - len += snprintf(buffer + len, sz_buffer - len, "

%s
",temp); + len += snprintf(buffer + len, sz_buffer - len, "
%s
",temp); const char *depth_unit; int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit); - len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "
ATM pressure: %dmbar (%d%s)
"), + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)
"), diveplan->surface_pressure, altitude, depth_unit); @@ -843,7 +843,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool else snprintf(temp, sz_temp, "%s %.*f|%.*f%s/min):", translate("gettextFromC", "Gas consumption (based on SAC"), sacdecimals, bottomsacvalue, sacdecimals, decosacvalue, sacunit); - len += snprintf(buffer + len, sz_buffer - len, "

%s
", temp); + len += snprintf(buffer + len, sz_buffer - len, "
%s
", temp); for (int gasidx = 0; gasidx < MAX_CYLINDERS; gasidx++) { double volume, pressure, deco_volume, deco_pressure; const char *unit, *pressure_unit; -- cgit v1.2.3-70-g09d2