From 42da9384e4f3792917ffc5aca64ec71f2ef07922 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Mon, 30 Jun 2014 14:24:11 +0200 Subject: Bug 731416 - [webkit-composer] Busy-loop when replying to an email When wrapping lines with really long words (more that is defined in Composer settings) the maximal length for wrap could be less than zero. For proper functionality we have to set it to the right value. --- e-util/e-html-editor-selection.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'e-util/e-html-editor-selection.c') diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index 2ddeef1047..938a06dc87 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -4917,10 +4917,15 @@ wrap_lines (EHTMLEditorSelection *selection, /* wrap until we have something */ while ((length_left + len) > word_wrap_length) { + gint max_length; + + max_length = word_wrap_length - len; + if (max_length < 0) + max_length = word_wrap_length; /* Find where we can line-break the node so that it * effectively fills the rest of current row */ offset = find_where_to_break_line ( - node, word_wrap_length - len, word_wrap_length); + node, max_length, word_wrap_length); element = webkit_dom_document_create_element (document, "BR", NULL); element_add_class (element, "-x-evo-wrap-br"); -- cgit v1.2.3