From bf860b3f99d7588469f16acd10f7758889e11fd1 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Tue, 15 Jul 2014 10:59:08 +0200 Subject: Bug 732608 - Composer paste issues We have to treat the pasting into the normal and the quoted content separately. We have to also correctly process the new lines on the beginning/end of the pasted content to avoid their lose. --- e-util/e-html-editor-selection.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'e-util/e-html-editor-selection.c') diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index 01141c7df4..f790f12d8b 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -4134,9 +4134,13 @@ e_html_editor_selection_insert_html (EHTMLEditorSelection *selection, g_return_if_fail (view != NULL); command = E_HTML_EDITOR_VIEW_COMMAND_INSERT_HTML; - if (e_html_editor_view_get_html_mode (view)) + if (e_html_editor_view_get_html_mode (view)) { e_html_editor_view_exec_command (view, command, html_text); - else + e_html_editor_view_check_magic_links (view, FALSE); + e_html_editor_view_force_spell_check (view); + + e_html_editor_selection_scroll_to_caret (selection); + } else e_html_editor_view_convert_and_insert_html_to_plain_text ( view, html_text); @@ -5238,12 +5242,12 @@ wrap_lines (EHTMLEditorSelection *selection, } else { webkit_dom_node_normalize (paragraph_clone); - /* Replace paragraph with wrapped one */ - webkit_dom_node_replace_child ( - webkit_dom_node_get_parent_node (paragraph), - paragraph_clone, - paragraph, - NULL); + node = webkit_dom_node_get_parent_node (paragraph); + if (node) { + /* Replace paragraph with wrapped one */ + webkit_dom_node_replace_child ( + node, paragraph_clone, paragraph, NULL); + } return WEBKIT_DOM_ELEMENT (paragraph_clone); } -- cgit v1.2.3