aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-text/e-text.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/e-text/e-text.c')
-rw-r--r--widgets/e-text/e-text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/widgets/e-text/e-text.c b/widgets/e-text/e-text.c
index ed87f21c95..cb064c9c40 100644
--- a/widgets/e-text/e-text.c
+++ b/widgets/e-text/e-text.c
@@ -683,8 +683,8 @@ calc_line_widths (EText *text)
{
struct line *lines;
int i;
- int j;
gdouble clip_width;
+ gchar *p;
/* Make sure line has been split */
if (text->text && text->num_lines == 0)
@@ -721,10 +721,10 @@ calc_line_widths (EText *text)
clip_width >= 0) {
if (text->font) {
lines->ellipsis_length = 0;
- for (j = 0; j < lines->length; j++ ) {
- if (e_font_utf8_text_width (text->font, E_FONT_PLAIN, lines->text, j) + text->ellipsis_width
- <= clip_width)
- lines->ellipsis_length = j;
+ for (p = lines->text; p && *p && (p - lines->text) < lines->length; p = unicode_next_utf8 (p)) {
+ if (e_font_utf8_text_width (text->font, E_FONT_PLAIN, lines->text, p - lines->text) +
+ text->ellipsis_width <= clip_width)
+ lines->ellipsis_length = p - lines->text;
else
break;
}