aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-27 22:06:07 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-27 22:12:02 +0800
commit6a0592918ac4bf109d67b619cdf3835239b700d4 (patch)
tree29eac1651b3ee2923a7a95ab3888ab67a7b1d231 /composer
parent94ac03022048a12b6a43c970ab6a95eef865e7b6 (diff)
downloadgsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar.gz
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar.bz2
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar.lz
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar.xz
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.tar.zst
gsoc2013-evolution-6a0592918ac4bf109d67b619cdf3835239b700d4.zip
Fix handling of the selection in the composer when saving the message draft
When saving the draft don't lose the active selection in the web view. Also restore the selection when the draft is again opened. Also fix the situations when the spell check was not activated when the composer was opened.
Diffstat (limited to 'composer')
-rw-r--r--composer/e-composer-private.c12
-rw-r--r--composer/e-msg-composer.c4
2 files changed, 7 insertions, 9 deletions
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 79bba3dfe6..69d6db42a5 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -867,10 +867,8 @@ composer_move_caret (EMsgComposer *composer)
"data-edit-as-new",
"",
NULL);
- e_html_editor_selection_restore_caret_position (editor_selection);
- e_html_editor_selection_scroll_to_caret (editor_selection);
- e_html_editor_view_force_spell_check (view);
+ e_html_editor_selection_scroll_to_caret (editor_selection);
return;
}
@@ -930,7 +928,6 @@ composer_move_caret (EMsgComposer *composer)
e_html_editor_selection_restore_caret_position (editor_selection);
if (!html_mode)
e_html_editor_view_quote_plain_text (view);
- e_html_editor_view_force_spell_check (view);
input_start = webkit_dom_document_get_element_by_id (
document, "-x-evo-input-start");
@@ -979,8 +976,6 @@ composer_move_caret (EMsgComposer *composer)
}
}
- e_html_editor_view_force_spell_check (view);
-
webkit_dom_range_select_node_contents (
new_range,
WEBKIT_DOM_NODE (
@@ -995,6 +990,8 @@ composer_move_caret (EMsgComposer *composer)
g_object_unref (list);
g_object_unref (blockquotes);
+ e_html_editor_view_force_spell_check (view);
+
e_html_editor_selection_unblock_selection_changed (editor_selection);
}
@@ -1253,7 +1250,8 @@ e_composer_update_signature (EMsgComposer *composer)
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
- /* Do nothing if we're redirecting a message or we disabled the signature * on purpose */
+ /* Do nothing if we're redirecting a message or we disabled
+ * the signature on purpose */
if (composer->priv->redirect || composer->priv->disable_signature)
return;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 8c1748c4c3..a728263524 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1239,12 +1239,12 @@ composer_build_message (EMsgComposer *composer,
data = g_byte_array_new ();
e_html_editor_view_embed_styles (view);
- e_html_editor_selection_save_caret_position (selection);
+ e_html_editor_selection_save (selection);
text = e_html_editor_view_get_text_html_for_drafts (view);
e_html_editor_view_remove_embed_styles (view);
- e_html_editor_selection_restore_caret_position (selection);
+ e_html_editor_selection_restore (selection);
g_byte_array_append (data, (guint8 *) text, strlen (text));