[gspell] InlineCheckerTextBuffer: add assertions in adjust_iters()



commit 50b0061885c77cb4cd8e0ac1fa2d1b30e70b0dec
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Feb 22 15:49:42 2017 +0100

    InlineCheckerTextBuffer: add assertions in adjust_iters()
    
    I've re-read the _gspell_text_iter_*() implementation, and I don't see
    any bugs. Maybe there is a bug in gtk_text_iter_*() or pango.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778883

 gspell/gspell-inline-checker-text-buffer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-text-buffer.c b/gspell/gspell-inline-checker-text-buffer.c
index af41b67..58ae1b5 100644
--- a/gspell/gspell-inline-checker-text-buffer.c
+++ b/gspell/gspell-inline-checker-text-buffer.c
@@ -194,12 +194,14 @@ adjust_iters (GtkTextIter *start,
                            !_gspell_text_iter_starts_word (start))
                        {
                                _gspell_text_iter_backward_word_start (start);
+                               g_assert (_gspell_text_iter_starts_word (start));
                        }
 
                        if (_gspell_text_iter_inside_word (end) &&
                            !_gspell_text_iter_starts_word (end))
                        {
                                _gspell_text_iter_forward_word_end (end);
+                               g_assert (_gspell_text_iter_ends_word (end));
                        }
                        break;
 
@@ -209,11 +211,13 @@ adjust_iters (GtkTextIter *start,
                             !_gspell_text_iter_starts_word (start)))
                        {
                                _gspell_text_iter_backward_word_start (start);
+                               g_assert (_gspell_text_iter_starts_word (start));
                        }
 
                        if (_gspell_text_iter_inside_word (end))
                        {
                                _gspell_text_iter_forward_word_end (end);
+                               g_assert (_gspell_text_iter_ends_word (end));
                        }
                        break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]