From: Matthew Fernandez Date: Thu, 14 Jul 2022 04:36:34 +0000 (-0700) Subject: common parse_reclbl: reflow some lines X-Git-Tag: 5.0.1~36^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f50d17a192967aa68f9260ddb489c0399690eed;p=graphviz common parse_reclbl: reflow some lines An attempt to make this dense function slightly more comprehensible. --- diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 18009fd9b..3f256ee1a 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -3220,8 +3220,7 @@ static field_t *parse_reclbl(node_t *n, bool LR, int flag, char *text) { for (maxf = 1, cnt = 0, sp = reclblp; *sp; sp++) { if (*sp == '\\') { sp++; - if (*sp - && (*sp == '{' || *sp == '}' || *sp == '|' || *sp == '\\')) + if (*sp && (*sp == '{' || *sp == '}' || *sp == '|' || *sp == '\\')) continue; } if (*sp == '{') @@ -3289,15 +3288,13 @@ static field_t *parse_reclbl(node_t *n, bool LR, int flag, char *text) { if (!(mode & (HASTEXT | HASTABLE))) mode |= HASTEXT, *tsp++ = ' '; if (mode & HASTEXT) { - if (tsp > text + 1 && - tsp - 1 != hstsp && *(tsp - 1) == ' ') + if (tsp > text + 1 && tsp - 1 != hstsp && *(tsp - 1) == ' ') tsp--; *tsp = '\000'; fp->lp = make_label(n, text, (lbl->html ? LT_HTML : LT_NONE), - lbl->fontsize, lbl->fontname, - lbl->fontcolor); + lbl->fontsize, lbl->fontname, lbl->fontcolor); fp->LR = TRUE; hstsp = tsp = text; } @@ -3332,8 +3329,7 @@ static field_t *parse_reclbl(node_t *n, bool LR, int flag, char *text) { if (!(mode & (INTEXT | INPORT)) && *reclblp != ' ') mode |= (INTEXT | HASTEXT); if (mode & INTEXT) { - if (! - (*reclblp == ' ' && !ishardspace && *(tsp - 1) == ' ' + if (!(*reclblp == ' ' && !ishardspace && *(tsp - 1) == ' ' && !lbl->html)) *tsp++ = *reclblp; if (ishardspace)