[evolution] Bug 733477 - Paste can select following text



commit 1e50111cf877d283df29954524f0ab23b535dac0
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Jul 22 09:53:14 2014 +0200

    Bug 733477 - Paste can select following text
    
    When pasting the content that was copied from the composer, WebKit
    restores the selection wrongly, thus is saved wrongly and we have
    to fix it.

 e-util/e-html-editor-view.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index d78baa4..480d681 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -4386,6 +4386,23 @@ html_editor_view_insert_converted_html_into_selection (EHTMLEditorView *view,
 
                if (!has_selection)
                        remove_node (parent);
+       } else {
+               /* When pasting the content that was copied from the composer, WebKit
+                * restores the selection wrongly, thus is saved wrongly and we have
+                * to fix it */
+               WebKitDOMElement *selection_start_marker, *selection_end_marker;
+
+               selection_start_marker = webkit_dom_document_get_element_by_id (
+                       document, "-x-evo-selection-start-marker");
+               selection_end_marker = webkit_dom_document_get_element_by_id (
+                       document, "-x-evo-selection-end-marker");
+               webkit_dom_node_insert_before (
+                       webkit_dom_node_get_parent_node (
+                               WEBKIT_DOM_NODE (selection_start_marker)),
+                       WEBKIT_DOM_NODE (selection_end_marker),
+                       webkit_dom_node_get_next_sibling (
+                               WEBKIT_DOM_NODE (selection_start_marker)),
+                       NULL);
        }
 
        e_html_editor_selection_restore (selection);


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