From 0f50d17a192967aa68f9260ddb489c0399690eed Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 13 Jul 2022 21:36:34 -0700 Subject: [PATCH] common parse_reclbl: reflow some lines An attempt to make this dense function slightly more comprehensible. --- lib/common/shapes.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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) -- 2.40.0