[evolution] EHTMLEditorSelection - Save the selection marks to right position when it starts or ends near the qu
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EHTMLEditorSelection - Save the selection marks to right position when it starts or ends near the qu
- Date: Wed, 28 Jan 2015 10:16:12 +0000 (UTC)
commit cfb1a435481b677e2970ee8341a79d1f37078f6b
Author: Tomas Popela <tpopela redhat com>
Date: Wed Jan 28 10:40:45 2015 +0100
EHTMLEditorSelection - Save the selection marks to right position when it starts or ends near the quote
marks
e-util/e-html-editor-selection.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 254f820..b755072 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -6084,8 +6084,15 @@ e_html_editor_selection_save (EHTMLEditorSelection *selection)
WEBKIT_DOM_NODE (marker),
next_sibling,
NULL);
- return;
+ } else {
+ webkit_dom_node_insert_before (
+ node,
+ WEBKIT_DOM_NODE (marker),
+ webkit_dom_node_get_next_sibling (
+ webkit_dom_node_get_parent_node (parent_node)),
+ NULL);
}
+ return;
}
if (WEBKIT_DOM_IS_TEXT (container)) {
@@ -6138,8 +6145,14 @@ e_html_editor_selection_save (EHTMLEditorSelection *selection)
if (split_node) {
parent_node = webkit_dom_node_get_parent_node (split_node);
- webkit_dom_node_insert_before (
- parent_node, marker_node, split_node, NULL);
+ if (WEBKIT_DOM_IS_HTML_BODY_ELEMENT (parent_node)) {
+ webkit_dom_node_append_child (
+ webkit_dom_node_get_previous_sibling (split_node),
+ marker_node,
+ NULL);
+ } else
+ webkit_dom_node_insert_before (
+ parent_node, marker_node, split_node, NULL);
} else
webkit_dom_node_append_child (
WEBKIT_DOM_NODE (container), marker_node, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]