diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-07-22 15:53:14 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-07-22 15:53:14 +0800 |
commit | 1e50111cf877d283df29954524f0ab23b535dac0 (patch) | |
tree | a498f248b76b90969796db4a1785b5921bc59d1b /e-util/e-html-editor-view.c | |
parent | b3e10763baca2533dcb7d6a36cbd64d9b2e376a9 (diff) | |
download | gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar.gz gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar.bz2 gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar.lz gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar.xz gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.tar.zst gsoc2013-evolution-1e50111cf877d283df29954524f0ab23b535dac0.zip |
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.
Diffstat (limited to 'e-util/e-html-editor-view.c')
-rw-r--r-- | 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 d78baa423b..480d6812fa 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); |