From ee4ee504d8c6ca1e2fe5dd018da535f74638c526 Mon Sep 17 00:00:00 2001 From: Theppitak Karoonboonyanan Date: Mon, 14 Mar 2005 06:42:13 +0000 Subject: bounds check the selection beginning. 2005-03-14 Theppitak Karoonboonyanan * 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 --- widgets/text/e-text.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'widgets/text') 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; } -- cgit v1.2.3