| 263 outword = g_strdup(good); |
263 outword = g_strdup(good); |
| 264 |
264 |
| 265 g_value_unset(&val1); |
265 g_value_unset(&val1); |
| 266 g_value_unset(&val2); |
266 g_value_unset(&val2); |
| 267 |
267 |
| |
268 g_free(lowerword); |
| 268 g_free(foldedword); |
269 g_free(foldedword); |
| 269 return outword; |
270 return outword; |
| 270 } |
271 } |
| 271 |
272 |
| 272 g_value_unset(&val1); |
273 g_value_unset(&val1); |
| 273 g_free(tmpbad); |
274 g_free(tmpbad); |
| 274 |
275 |
| 275 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); |
276 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); |
| 276 } |
277 } |
| |
278 g_free(lowerword); |
| 277 g_free(foldedword); |
279 g_free(foldedword); |
| 278 |
280 |
| 279 return NULL; |
281 return NULL; |
| 280 } |
282 } |
| 281 |
283 |
| 438 gtk_text_iter_forward_char(&end); |
441 gtk_text_iter_forward_char(&end); |
| 439 |
442 |
| 440 /* Move backwards to the beginning of the word. */ |
443 /* Move backwards to the beginning of the word. */ |
| 441 spellchk_backward_word_start(&start); |
444 spellchk_backward_word_start(&start); |
| 442 |
445 |
| |
446 g_free(spell->word); |
| 443 spell->word = gtk_text_iter_get_text(&start, &end); |
447 spell->word = gtk_text_iter_get_text(&start, &end); |
| 444 |
448 |
| 445 /* Hack because otherwise typing things like U.S. gets difficult |
449 /* Hack because otherwise typing things like U.S. gets difficult |
| 446 * if you have 'u' -> 'you' set as a correction... |
450 * if you have 'u' -> 'you' set as a correction... |
| 447 * |
451 * |
| 559 mark = gtk_text_buffer_get_insert(buffer); |
565 mark = gtk_text_buffer_get_insert(buffer); |
| 560 gtk_text_buffer_get_iter_at_mark(buffer, &pos, mark); |
566 gtk_text_buffer_get_iter_at_mark(buffer, &pos, mark); |
| 561 place = gtk_text_iter_get_offset(&pos); |
567 place = gtk_text_iter_get_offset(&pos); |
| 562 |
568 |
| 563 if ((place + 1) != spell->pos) { |
569 if ((place + 1) != spell->pos) { |
| |
570 g_free(spell->word); |
| 564 spell->word = NULL; |
571 spell->word = NULL; |
| 565 return; |
572 return; |
| 566 } |
573 } |
| 567 |
574 |
| 568 gtk_text_buffer_get_iter_at_mark(buffer, &start2, spell->mark_insert_start); |
575 gtk_text_buffer_get_iter_at_mark(buffer, &start2, spell->mark_insert_start); |
| 572 gtk_text_buffer_insert(buffer, &start2, spell->word, -1); |
579 gtk_text_buffer_insert(buffer, &start2, spell->word, -1); |
| 573 spell->ignore_correction = TRUE; |
580 spell->ignore_correction = TRUE; |
| 574 spell->ignore_correction_on_send = TRUE; |
581 spell->ignore_correction_on_send = TRUE; |
| 575 |
582 |
| 576 spell->inserting = FALSE; |
583 spell->inserting = FALSE; |
| |
584 g_free(spell->word); |
| 577 spell->word = NULL; |
585 spell->word = NULL; |
| 578 } |
586 } |
| 579 |
587 |
| 580 static void |
588 static void |
| 581 message_send_cb(GtkWidget *widget, spellchk *spell) |
589 message_send_cb(GtkWidget *widget, spellchk *spell) |