1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04:00

[text] Removed unused function

This commit is contained in:
Witold Filipczyk 2022-03-19 10:52:50 +01:00
parent 672e4becf7
commit 07abe94955
2 changed files with 0 additions and 56 deletions

View File

@ -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

View File

@ -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,