currRow = co->top + i;
}
- j = 4 + (3 * (*item)->depth);
- SLsmg_write_nstring(NULL, co->width - j);
- newtGotorc(co->top + i, co->left + j);
- if (wstrlen((*item)->text, -1) > co->width - j) {
- char *tmp;
- tmp = strdup((*item)->text);
- trim_string(tmp, co->width - j);
- SLsmg_write_string(tmp);
- free(tmp);
- } else
- SLsmg_write_string((*item)->text);
+ SLsmg_write_nstring((*item)->text, co->width - 4 - (3 * (*item)->depth));
item++;
i++;
SLsmg_write_char('_');
i++;
}
- } else {
- char *tmp;
- tmp = strdup(chptr);
- trim_string(tmp, co->width);
- SLsmg_write_string(tmp);
- free(tmp);
- }
+ } else
+ SLsmg_write_nstring(chptr, co->width);
newtGotorc(co->top, co->left + wstrlen(en->buf+en->firstChar, en->cursorPosition - en->firstChar));
}
else
SLsmg_set_color(NEWT_COLORSET_LISTBOX);
- SLsmg_write_nstring(NULL, li->curWidth);
- newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust);
- if (wstrlen(item->text, -1) > li->curWidth) {
- char *tmp;
- tmp = strdup(item->text);
- trim_string(tmp, li->curWidth);
- SLsmg_write_string(tmp);
- free(tmp);
- } else
- SLsmg_write_string(item->text);
+ SLsmg_write_nstring(item->text, li->curWidth);
if (li->flags & NEWT_FLAG_MULTIPLE) {
newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust);