[evolution/wip/webkit2] EEditorDOMFunctions - Indented block width could be set to 0



commit 67e7ee254030d4dcabc39866911f104596216138
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Jul 12 15:43:12 2016 +0200

    EEditorDOMFunctions - Indented block width could be set to 0

 .../web-extension/e-editor-dom-functions.c         |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c 
b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index 9329362..4fa29ca 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -11723,17 +11723,19 @@ dom_set_indented_style (EEditorPage *editor_page,
        webkit_dom_element_set_class_name (element, "-x-evo-indented");
 
        if (e_editor_page_get_html_mode (editor_page) || word_wrap_length == 0) {
-               gchar *plain_text_style;
-
                style = g_strdup_printf ("margin-left: %dch;", SPACES_PER_INDENTATION);
 
-               plain_text_style = g_strdup_printf (
+               if (word_wrap_length != 0) {
+                       gchar *plain_text_style;
+
+                       plain_text_style = g_strdup_printf (
                                "margin-left: %dch; word-wrap: normal; width: %dch;",
                                SPACES_PER_INDENTATION, word_wrap_length);
 
-               webkit_dom_element_set_attribute (
+                       webkit_dom_element_set_attribute (
                                element, "data-plain-text-style", plain_text_style, NULL);
-               g_free (plain_text_style);
+                       g_free (plain_text_style);
+               }
        } else {
                style = g_strdup_printf (
                        "margin-left: %dch; word-wrap: normal; width: %dch;",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]