From 07abe949550459bab030a4e571d352c2548c0f06 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 19 Mar 2022 10:52:50 +0100 Subject: [PATCH] [text] Removed unused function --- src/bfu/text.c | 53 -------------------------------------------------- src/bfu/text.h | 3 --- 2 files changed, 56 deletions(-) diff --git a/src/bfu/text.c b/src/bfu/text.c index dd7db12f..8fba9353 100644 --- a/src/bfu/text.c +++ b/src/bfu/text.c @@ -210,59 +210,6 @@ split_lines(struct widget_data *widget_data, int max_width) return lines; } -/* Format text according to dialog box and alignment. */ -void -dlg_format_text_do(struct dialog_data *dlg_data, - const char *text, - int x, int *y, int width, int *real_width, - struct color_pair *color, format_align_T align, - int format_only) -{ -#ifdef CONFIG_UTF8 - struct terminal *term = dlg_data->win->term; -#endif - int line_width; - int firstline = 1; - - for (; *text; text += line_width, (*y)++) { - int shift; - int cells = 0; - - /* Skip first leading \n or space. */ - if (!firstline && isspace(*text)) - text++; - else - firstline = 0; - if (!*text) break; - -#ifdef CONFIG_UTF8 - line_width = split_line(text, width, &cells, term->utf8_cp); -#else - line_width = split_line(text, width, &cells); -#endif /* CONFIG_UTF8 */ - - /* split_line() may return 0. */ - if (line_width < 1) { - line_width = 1; /* Infinite loop prevention. */ - continue; - } - - if (real_width) int_lower_bound(real_width, cells); - if (format_only || !line_width) continue; - - /* Calculate the number of chars to indent */ - if (align == ALIGN_CENTER) - shift = (width - cells) / 2; - else if (align == ALIGN_RIGHT) - shift = width - cells; - else - shift = 0; - - assert(cells <= width && shift < width); - - draw_dlg_text(dlg_data, x + shift, *y, text, line_width, 0, color); - } -} /* Format text according to dialog box and alignment. */ void diff --git a/src/bfu/text.h b/src/bfu/text.h index 158dcfcc..67520d78 100644 --- a/src/bfu/text.h +++ b/src/bfu/text.h @@ -50,9 +50,6 @@ void add_dlg_text(struct dialog *dlg, char *text, format_align_T align, int bottom_pad); extern const struct widget_ops text_ops; -void dlg_format_text_do(struct dialog_data *dlg_data, - const char *text, int x, int *y, int w, int *rw, - struct color_pair *scolor, format_align_T align, int format_only); void dlg_format_text_do_node(struct dialog_data *dlg_data, const char *text, int x, int *y, int w, int *rw,