[evolution/wip/webkit-composer] EEditorWidget: Insert quote symbols on empty lines



commit bb1c37e8deed695922a24c7d9e197d89f72f933b
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Feb 6 15:49:26 2014 +0100

    EEditorWidget: Insert quote symbols on empty lines
    
    There was some corner case where the epmty lines were not quoted.

 e-util/e-editor-widget.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/e-util/e-editor-widget.c b/e-util/e-editor-widget.c
index 06d0f22..97be598 100644
--- a/e-util/e-editor-widget.c
+++ b/e-util/e-editor-widget.c
@@ -2115,9 +2115,7 @@ quote_node (WebKitDOMDocument *document,
 
                /* Do temporary wrapper */
                wrapper = webkit_dom_document_create_element (document, "SPAN", NULL);
-               webkit_dom_element_set_class_name (
-                       wrapper,
-                       "-x-evo-temp-text-wrapper");
+               webkit_dom_element_set_class_name (wrapper, "-x-evo-temp-text-wrapper");
 
                node_clone = webkit_dom_node_clone_node (node, TRUE);
 
@@ -2324,10 +2322,24 @@ quote_plain_text_recursive (WebKitDOMDocument *document,
                                                        skip_node = TRUE;
                                                        goto next_node;
                                                }
+
                                                if (is_citation_node (prev_sibling)) {
                                                        insert_quote_symbols_before_node (
                                                                document, node, quote_level, FALSE);
                                                }
+
+                                               if (WEBKIT_DOM_IS_ELEMENT (prev_sibling) &&
+                                                   element_has_class (WEBKIT_DOM_ELEMENT (prev_sibling), 
"-x-evo-temp-text-wrapper")) {
+                                                       gchar *text_content;
+
+                                                       text_content = webkit_dom_node_get_text_content 
(prev_sibling);
+                                                       if (g_strcmp0 (text_content, "") == 0)
+                                                               insert_quote_symbols_before_node (
+                                                                       document, node, quote_level, FALSE);
+
+                                                       g_free (text_content);
+
+                                               }
                                        }
                                        quote_node (document, node, quote_level);
                                }


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