static void set_auto_spell (GeditWindow *window, GeditDocument *doc, gboolean active) { GeditAutomaticSpellChecker *autospell; GeditSpellChecker *spell; spell = get_spell_checker_from_document (doc); g_return_if_fail (spell != NULL); autospell = gedit_automatic_spell_checker_get_from_document (doc); if (active) { if (autospell == NULL) { GeditView *active_view; active_view = gedit_window_get_active_view (window); g_return_if_fail (active_view != NULL); autospell = gedit_automatic_spell_checker_new (doc, spell); gedit_automatic_spell_checker_attach_view (autospell, active_view); gedit_automatic_spell_checker_recheck_all (autospell); } } else { if (autospell != NULL) gedit_automatic_spell_checker_free (autospell); } }
static void set_auto_spell (GeditWindow *window, GeditView *view, gboolean active) { GeditAutomaticSpellChecker *autospell; GeditSpellChecker *spell; GeditDocument *doc; doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); spell = get_spell_checker_from_document (doc); g_return_if_fail (spell != NULL); autospell = gedit_automatic_spell_checker_get_from_document (doc); if (active) { if (autospell == NULL) { autospell = gedit_automatic_spell_checker_new (doc, spell); gedit_automatic_spell_checker_attach_view (autospell, view); gedit_automatic_spell_checker_recheck_all (autospell); } } else { if (autospell != NULL) gedit_automatic_spell_checker_free (autospell); } }