diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-06-25 16:33:32 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-06-25 21:59:50 +0800 |
commit | 0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d (patch) | |
tree | 2497444e05f18809e6e9ccec1fdcf6f1081ee430 /e-util | |
parent | bfde2f572e5b461e34f607fbdc6e018c34b5cdf8 (diff) | |
download | gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar.gz gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar.bz2 gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar.lz gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar.xz gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.tar.zst gsoc2013-evolution-0affae2fac8bb49b23a7f9bec8d048eb5ee6c18d.zip |
EHTMLEditorView - Process the element only if it has children
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-html-editor-view.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 2bdd06464b..343a0d3676 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -5394,19 +5394,20 @@ convert_element_from_html_to_plain_text (EHTMLEditorView *view, first_child = webkit_dom_node_get_first_child ( WEBKIT_DOM_NODE (element)); - - if (!webkit_dom_node_has_child_nodes (first_child)) { - webkit_dom_html_element_set_inner_html ( - WEBKIT_DOM_HTML_ELEMENT (first_child), - UNICODE_ZERO_WIDTH_SPACE, + if (first_child) { + if (!webkit_dom_node_has_child_nodes (first_child)) { + webkit_dom_html_element_set_inner_html ( + WEBKIT_DOM_HTML_ELEMENT (first_child), + UNICODE_ZERO_WIDTH_SPACE, + NULL); + } + webkit_dom_node_insert_before ( + first_child, + e_html_editor_selection_get_caret_position_node ( + document), + webkit_dom_node_get_first_child (first_child), NULL); } - webkit_dom_node_insert_before ( - first_child, - e_html_editor_selection_get_caret_position_node ( - document), - webkit_dom_node_get_first_child (first_child), - NULL); *wrap = TRUE; } |