aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index ed87f21c95..cb064c9c40 100644
--- a/widgets/text/e-text.c
+++ b/widgets/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;
}