static void editor_replace_all_cb (GtkhtmlEditor *editor, const gchar *correction, GtkhtmlSpellDialog *dialog) { GtkHTML *html; gchar *misspelled; html = gtkhtml_editor_get_html (editor); /* Replace this occurrence. */ misspelled = html_engine_get_spell_word (html->engine); html_engine_replace_spell_word_with (html->engine, correction); /* Replace all subsequent occurrences. */ while (gtkhtml_editor_next_spell_error (editor)) { gchar *word; word = html_engine_get_spell_word (html->engine); if (g_str_equal (word, misspelled)) html_engine_replace_spell_word_with ( html->engine, correction); g_free (word); } /* Jump to beginning of document (XXX is this right?) */ html_engine_beginning_of_document (html->engine); gtkhtml_spell_dialog_next_word (dialog); g_free (misspelled); }
static void editor_replace_cb (GtkhtmlEditor *editor, const gchar *correction, GtkhtmlSpellDialog *dialog) { GtkHTML *html; html = gtkhtml_editor_get_html (editor); html_engine_replace_spell_word_with (html->engine, correction); gtkhtml_spell_dialog_next_word (dialog); }
static void spell_dialog_ignore_cb (GtkhtmlSpellDialog *dialog) { GtkhtmlSpellChecker *checker; const gchar *word; checker = gtkhtml_spell_dialog_get_active_checker (dialog); word = gtkhtml_spell_dialog_get_word (dialog); gtkhtml_spell_checker_add_word_to_session (checker, word, -1); g_signal_emit (dialog, signals[IGNORED], 0); gtkhtml_spell_dialog_next_word (dialog); }