Check bounds when setting selection. (#7302)

Wed Jan 31 20:33:35 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
	when setting selection. (#7302)
This commit is contained in:
Owen Taylor
2001-02-01 01:50:49 +00:00
committed by Owen Taylor
parent c007e30064
commit 6ceae1b5bf
8 changed files with 40 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -1,3 +1,8 @@
Wed Jan 31 20:33:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
when setting selection. (#7302)
Thu Feb 1 02:26:18 2001 Tim Janik <timj@gtk.org>
* gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration

View File

@@ -2213,14 +2213,16 @@ gtk_entry_set_selection (GtkEditable *editable,
gint start,
gint end)
{
gint length = GTK_ENTRY (editable)->text_length;
g_return_if_fail (editable != NULL);
g_return_if_fail (GTK_IS_ENTRY (editable));
if (end < 0)
end = GTK_ENTRY (editable)->text_length;
end = length;
editable->selection_start_pos = start;
editable->selection_end_pos = end;
editable->selection_start_pos = CLAMP (start, 0, length);
editable->selection_end_pos = MIN (end, length);
gtk_entry_queue_draw (GTK_ENTRY (editable));
}