[evolution/wip/webkit2] EHTMLEditorSelection - Selection is wrongly restored when it is on the end of block
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] EHTMLEditorSelection - Selection is wrongly restored when it is on the end of block
- Date: Tue, 1 Mar 2016 14:49:36 +0000 (UTC)
commit cdc7e045822f3ab7f0d6a128876a4ee3c4953601
Author: Tomas Popela <tpopela redhat com>
Date: Tue Mar 1 14:56:57 2016 +0100
EHTMLEditorSelection - Selection is wrongly restored when it is on the end of block
.../e-html-editor-selection-dom-functions.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-selection-dom-functions.c
b/web-extensions/composer/e-html-editor-selection-dom-functions.c
index 5c8bf2d..f645f3e 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.c
@@ -1907,15 +1907,21 @@ dom_selection_restore (WebKitDOMDocument *document)
ok = dom_is_selection_position_node (selection_end_marker);
if (ok) {
- parent_start = webkit_dom_node_get_parent_node (selection_end_marker);
+ WebKitDOMNode *next_sibling;
- remove_node (selection_start_marker);
- remove_node (selection_end_marker);
+ next_sibling = webkit_dom_node_get_next_sibling
(selection_end_marker);
- webkit_dom_node_normalize (parent_start);
- g_object_unref (range);
- g_object_unref (dom_selection);
- return;
+ if (next_sibling && !WEBKIT_DOM_IS_HTML_BR_ELEMENT (next_sibling)) {
+ parent_start = webkit_dom_node_get_parent_node
(selection_end_marker);
+
+ remove_node (selection_start_marker);
+ remove_node (selection_end_marker);
+
+ webkit_dom_node_normalize (parent_start);
+ g_object_unref (range);
+ g_object_unref (dom_selection);
+ return;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]