From 0a4e3a2492e11481c6fd32fddad0f3faf7735b31 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Thu, 31 Jul 2014 12:24:40 +0200 Subject: EHTMLEditorSelection - Introduce e_html_editor_selection_is_collapsed and use it where possible Before we were comparing the selection text to look if the selection is collapsed. Use webkit_dom_range_get_collapsed instead. --- e-util/e-html-editor-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'e-util/e-html-editor-view.c') diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 2b21fa04a3..5e20758ce6 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -2482,7 +2482,7 @@ html_editor_view_key_press_event (GtkWidget *widget, /* BackSpace pressed in the beginning of quoted content changes * format to normal and inserts text into body */ - if (g_strcmp0 (e_html_editor_selection_get_string (selection), "") == 0) { + if (e_html_editor_selection_is_collapsed (selection)) { e_html_editor_selection_save (selection); if (change_quoted_block_to_normal (view)) { e_html_editor_selection_restore (selection); @@ -4337,7 +4337,7 @@ html_editor_view_insert_converted_html_into_selection (EHTMLEditorView *view, g_free (inner_html); - has_selection = g_strcmp0 (e_html_editor_selection_get_string (selection), "") != 0; + has_selection = !e_html_editor_selection_is_collapsed (selection); range = html_editor_view_get_dom_range (view); node = webkit_dom_range_get_end_container (range, NULL); -- cgit v1.2.3