[evolution] EHTMLEditorView - Only change a smiley to plain text when the node is smiley



commit 9427bd91082e2638a2817eec197e3c06a7604a27
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Jan 15 14:31:55 2016 +0100

    EHTMLEditorView - Only change a smiley to plain text when the node is smiley
    
    Before this, pressing the Backspace key in an empty item on the end of list
    could remove the whole list.

 e-util/e-html-editor-view.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 9c87799..8ccabd4 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -5588,12 +5588,15 @@ change_smiley_to_plain_text (EHTMLEditorView *view)
                                        WEBKIT_DOM_CHARACTER_DATA (prev_sibling));
 
                                if (g_strcmp0 (text, UNICODE_ZERO_WIDTH_SPACE) == 0) {
-                                       remove_node (prev_sibling);
-                                       in_smiley = TRUE;
-                                       prev_sibling = webkit_dom_node_get_previous_sibling (WEBKIT_DOM_NODE 
(element));
-                                       if (WEBKIT_DOM_IS_ELEMENT (prev_sibling) &&
-                                           element_has_class (WEBKIT_DOM_ELEMENT (prev_sibling), 
"-x-evo-smiley-wrapper"))
+                                       WebKitDOMNode *prev_prev_sibling;
+
+                                       prev_prev_sibling = webkit_dom_node_get_previous_sibling 
(prev_sibling);
+                                       if (WEBKIT_DOM_IS_ELEMENT (prev_prev_sibling) &&
+                                           element_has_class (WEBKIT_DOM_ELEMENT (prev_prev_sibling), 
"-x-evo-smiley-wrapper")) {
+                                               remove_node (prev_sibling);
+                                               in_smiley = TRUE;
                                                parent = webkit_dom_node_get_last_child (prev_sibling);
+                                       }
                                }
 
                                g_free (text);


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