diff options
author | Theppitak Karoonboonyanan <theppitak@gmail.com> | 2005-03-14 14:42:13 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-03-14 14:42:13 +0800 |
commit | ee4ee504d8c6ca1e2fe5dd018da535f74638c526 (patch) | |
tree | bf6b67c5d74c446fafa8c0408e583dd7af5e0668 /widgets/text | |
parent | c66108e0fcd6b4fc23eb00aa48f08881e1c89599 (diff) | |
download | gsoc2013-evolution-ee4ee504d8c6ca1e2fe5dd018da535f74638c526.tar.gz gsoc2013-evolution-ee4ee504d8c6ca1e2fe5dd018da535f74638c526.tar.zst gsoc2013-evolution-ee4ee504d8c6ca1e2fe5dd018da535f74638c526.zip |
bounds check the selection beginning.
2005-03-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
* gal/e-text/e-text.c (e_text_retrieve_surrounding_cb)
(e_text_delete_surrounding_cb): bounds check the selection
beginning.
svn path=/trunk/; revision=29008
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-text.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index b3ad50b868..8bf0ffcfc1 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -3848,7 +3848,7 @@ e_text_retrieve_surrounding_cb (GtkIMContext *context, gtk_im_context_set_surrounding (context, text->text, strlen (text->text), - g_utf8_offset_to_pointer (text->text, text->selection_start) - text->text); + g_utf8_offset_to_pointer (text->text, MIN (text->selection_start, text->selection_end)) - text->text); return TRUE; } @@ -3859,9 +3859,9 @@ e_text_delete_surrounding_cb (GtkIMContext *context, gint n_chars, EText *text) { - gtk_editable_delete_text (GTK_EDITABLE (text), - text->selection_end + offset, - text->selection_end + offset + n_chars); + e_text_model_delete (text->model, + MIN (text->selection_start, text->selection_end) + offset, + n_chars); return TRUE; } |