[evolution] Bug 752086 - Paste with a space on the right adds also new-line
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 752086 - Paste with a space on the right adds also new-line
- Date: Fri, 10 Jul 2015 11:05:26 +0000 (UTC)
commit 43847916c15432e6c6da1e495735285d6e7ec0e6
Author: Tomas Popela <tpopela redhat com>
Date: Fri Jul 10 13:03:32 2015 +0200
Bug 752086 - Paste with a space on the right adds also new-line
If the text to insert was converted just to one block, pass just its text to
WebKit otherwise WebKit will insert unwanted block with extra new line.
e-util/e-html-editor-view.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 73a374c..62e8406 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -7483,8 +7483,16 @@ html_editor_view_insert_converted_html_into_selection (EHTMLEditorView *view,
remove_node (WEBKIT_DOM_NODE (selection_start_marker));
remove_node (WEBKIT_DOM_NODE (selection_end_marker));
- inner_html = webkit_dom_html_element_get_inner_html (
- WEBKIT_DOM_HTML_ELEMENT (element));
+ /* If the text to insert was converted just to one block, pass just its
+ * text to WebKit otherwise WebKit will insert unwanted block with
+ * extra new line. */
+ if (!webkit_dom_node_get_next_sibling (webkit_dom_node_get_first_child (WEBKIT_DOM_NODE (element))))
+ inner_html = webkit_dom_html_element_get_inner_html (
+ WEBKIT_DOM_HTML_ELEMENT (webkit_dom_node_get_first_child (WEBKIT_DOM_NODE
(element))));
+ else
+ inner_html = webkit_dom_html_element_get_inner_html (
+ WEBKIT_DOM_HTML_ELEMENT (element));
+
e_html_editor_view_exec_command (
view, E_HTML_EDITOR_VIEW_COMMAND_INSERT_HTML, inner_html);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]