diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-08-17 15:02:11 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-08-17 15:02:11 +0800 |
commit | e3849d0f090cc292b5ff4282d694854f20369906 (patch) | |
tree | b77061662ba01ae953206edb0925a3b4efa4bec4 /e-util/e-html-editor-view.c | |
parent | 91805250658eca21f6c6b0a6909006052893cc29 (diff) | |
download | gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar.gz gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar.bz2 gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar.lz gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar.xz gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.tar.zst gsoc2013-evolution-e3849d0f090cc292b5ff4282d694854f20369906.zip |
EHTMLEditorView - Avoid critical warnings when pressing backspace on the beginning of the quoted content
Diffstat (limited to 'e-util/e-html-editor-view.c')
-rw-r--r-- | e-util/e-html-editor-view.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index be378b471f..d5fcdc9b6a 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -2342,24 +2342,26 @@ change_quoted_block_to_normal (EHTMLEditorView *view) paragraph = insert_new_line_into_citation (view, inner_html); g_free (inner_html); - if (view->priv->html_mode) { - webkit_dom_node_insert_before ( - WEBKIT_DOM_NODE (paragraph), - WEBKIT_DOM_NODE (selection_start_marker), - webkit_dom_node_get_first_child ( - WEBKIT_DOM_NODE (paragraph)), - NULL); - webkit_dom_node_insert_before ( - WEBKIT_DOM_NODE (paragraph), - WEBKIT_DOM_NODE (selection_end_marker), - webkit_dom_node_get_first_child ( - WEBKIT_DOM_NODE (paragraph)), - NULL); + if (paragraph) { + if (view->priv->html_mode) { + webkit_dom_node_insert_before ( + WEBKIT_DOM_NODE (paragraph), + WEBKIT_DOM_NODE (selection_start_marker), + webkit_dom_node_get_first_child ( + WEBKIT_DOM_NODE (paragraph)), + NULL); + webkit_dom_node_insert_before ( + WEBKIT_DOM_NODE (paragraph), + WEBKIT_DOM_NODE (selection_end_marker), + webkit_dom_node_get_first_child ( + WEBKIT_DOM_NODE (paragraph)), + NULL); - } + } - remove_quoting_from_element (paragraph); - remove_wrapping_from_element (paragraph); + remove_quoting_from_element (paragraph); + remove_wrapping_from_element (paragraph); + } if (block) remove_node (WEBKIT_DOM_NODE (block)); @@ -2367,9 +2369,11 @@ change_quoted_block_to_normal (EHTMLEditorView *view) document, "-x-evo-to-remove"); if (block) remove_node (WEBKIT_DOM_NODE (block)); - remove_node_if_empty ( - webkit_dom_node_get_next_sibling ( - WEBKIT_DOM_NODE (paragraph))); + + if (paragraph) + remove_node_if_empty ( + webkit_dom_node_get_next_sibling ( + WEBKIT_DOM_NODE (paragraph))); } if (success && citation_level > 1) { |