diff options
author | Tomas Popela <tpopela@redhat.com> | 2016-01-15 14:31:55 +0100 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2016-01-15 14:41:47 +0100 |
commit | bd56b16bee5a35ad91973dd834fe738c7c0f1241 (patch) | |
tree | 2e15eb22826840a47316fc6d22e56debabb837c4 | |
parent | 71d268bbadc0207218bd1aedb766b1fbd59de105 (diff) | |
download | evolution-bd56b16bee5a35ad91973dd834fe738c7c0f1241.tar.gz |
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.
-rw-r--r-- | 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 9423b1d56a..4ece012474 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); |