diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-07-15 16:42:00 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-07-15 17:10:00 +0800 |
commit | de832c906f73be6ec77f7bfec2e648fee22fe737 (patch) | |
tree | baf3206ee1ba245df8ebd413a5a8363352b0347d /e-util/e-html-editor-selection.c | |
parent | ff0aebc54828ada90f5524eb66568a88817cca43 (diff) | |
download | gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar.gz gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar.bz2 gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar.lz gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar.xz gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.tar.zst gsoc2013-evolution-de832c906f73be6ec77f7bfec2e648fee22fe737.zip |
EHTMLEditorView - Save selection instead of just caret position when forcing the spell check
Diffstat (limited to 'e-util/e-html-editor-selection.c')
-rw-r--r-- | e-util/e-html-editor-selection.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index 4cfe976571..01141c7df4 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -1983,8 +1983,8 @@ format_change_block_to_list (EHTMLEditorSelection *selection, merge_lists_if_possible (WEBKIT_DOM_NODE (list)); - e_html_editor_view_force_spell_check (view); e_html_editor_selection_restore (selection); + e_html_editor_view_force_spell_check (view); } static void @@ -2163,7 +2163,6 @@ e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection, EHTMLEditorView *view; EHTMLEditorSelectionBlockFormat current_format; const gchar *value; - gboolean has_selection = FALSE; gboolean from_list = FALSE, to_list = FALSE, html_mode; WebKitDOMDocument *document; WebKitDOMRange *range; @@ -2222,9 +2221,6 @@ e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection, break; } - if (g_strcmp0 (e_html_editor_selection_get_string (selection), "") != 0) - has_selection = TRUE; - /* H1 - H6 have bold font by default */ if (format >= E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H1 && format <= E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H6) @@ -2257,8 +2253,7 @@ e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection, if (!from_list && to_list) format_change_block_to_list (selection, format, view, document); - if (!has_selection) - e_html_editor_view_force_spell_check (view); + e_html_editor_view_force_spell_check (view); g_object_unref (view); @@ -2821,11 +2816,9 @@ e_html_editor_selection_indent (EHTMLEditorSelection *selection) block = next_block; } - out: - e_html_editor_view_force_spell_check (view); - e_html_editor_selection_restore (selection); + e_html_editor_view_force_spell_check (view); g_object_unref (view); @@ -3100,9 +3093,8 @@ e_html_editor_selection_unindent (EHTMLEditorSelection *selection) block = next_block; } out: - e_html_editor_view_force_spell_check (view); - e_html_editor_selection_restore (selection); + e_html_editor_view_force_spell_check (view); g_object_unref (view); |