Commit f2717be2 authored by Milan Crha's avatar Milan Crha
Browse files

Bug 783353 - Composer spell checks with no language selected

parent 26edb3f5
......@@ -475,6 +475,8 @@ html_editor_spell_languages_changed (EHTMLEditor *editor)
languages = e_spell_checker_list_active_languages (spell_checker, NULL);
e_content_editor_set_spell_check_enabled (cnt_editor, languages && *languages);
/* Set the languages for webview to highlight misspelled words */
e_content_editor_set_spell_checking_languages (cnt_editor, (const gchar **) languages);
......@@ -483,8 +485,6 @@ html_editor_spell_languages_changed (EHTMLEditor *editor)
E_HTML_EDITOR_SPELL_CHECK_DIALOG (
editor->priv->spell_check_dialog));
e_content_editor_set_spell_check_enabled (cnt_editor, languages && *languages);
g_clear_object (&spell_checker);
g_strfreev (languages);
}
......@@ -563,6 +563,12 @@ html_editor_parent_changed (GtkWidget *widget,
}
}
static void
html_editor_realize (GtkWidget *widget)
{
html_editor_spell_languages_changed (E_HTML_EDITOR (widget));
}
static void
html_editor_set_property (GObject *object,
guint property_id,
......@@ -726,6 +732,8 @@ html_editor_constructed (GObject *object)
gtk_toolbar_insert (toolbar, tool_item, 0);
priv->size_combo_box = g_object_ref (widget);
gtk_widget_show_all (GTK_WIDGET (tool_item));
g_signal_connect_after (object, "realize", G_CALLBACK (html_editor_realize), NULL);
}
static void
......
......@@ -2259,6 +2259,8 @@ static void
webkit_editor_set_spell_check_enabled (EWebKitEditor *wk_editor,
gboolean enable)
{
WebKitWebContext *web_context;
g_return_if_fail (E_IS_WEBKIT_EDITOR (wk_editor));
if ((wk_editor->priv->spell_check_enabled ? 1 : 0) == (enable ? 1 : 0))
......@@ -2269,6 +2271,9 @@ webkit_editor_set_spell_check_enabled (EWebKitEditor *wk_editor,
webkit_editor_call_simple_extension_function (
wk_editor, enable ? "DOMForceSpellCheck" : "DOMTurnSpellCheckOff");
web_context = webkit_web_view_get_context (WEBKIT_WEB_VIEW (wk_editor));
webkit_web_context_set_spell_checking_enabled (web_context, enable);
g_object_notify (G_OBJECT (wk_editor), "spell-check-enabled");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment