summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-03-21 00:08:19 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-03-21 00:08:19 +0000
commit22b1b079ef3c55c7a3e6f2bdb873130596b3456d (patch)
tree430914901d7c88447753559cf19f656fd4c8c154
parentdc5be9edc5cca70bdbd425f01be097ff82af63c4 (diff)
downloadgdk-pixbuf-22b1b079ef3c55c7a3e6f2bdb873130596b3456d.tar.gz
Short-circuit the text to the exact same thing, so we don't unexpectedly
Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit the text to the exact same thing, so we don't unexpectedly change the selection or cursor position. (#74290, John Ellis.)
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--ChangeLog.pre-2-27
-rw-r--r--ChangeLog.pre-2-47
-rw-r--r--ChangeLog.pre-2-67
-rw-r--r--ChangeLog.pre-2-87
-rw-r--r--gtk/gtkentry.c10
7 files changed, 50 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index e7af3fe62..9ef98e262 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,10 @@
+Wed Mar 20 19:00:03 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c (gtk_entry_set_text): Short-circuit
+ the text to the exact same thing, so we don't
+ unexpectedly change the selection or cursor position.
+ (#74290, John Ellis.)
+
Thu Mar 21 00:05:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_background_area),
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 9ef6c6e88..3e6534e88 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3266,14 +3266,20 @@ gtk_entry_new_with_max_length (gint max)
}
void
-gtk_entry_set_text (GtkEntry *entry,
+gtk_entry_set_text (GtkEntry *entry,
const gchar *text)
{
gint tmp_pos;
g_return_if_fail (GTK_IS_ENTRY (entry));
g_return_if_fail (text != NULL);
-
+
+ /* Actually setting the text will affect the cursor and selection;
+ * if the contents don't actually change, this will look odd to the user.
+ */
+ if (strcmp (entry->text, text) == 0)
+ return;
+
gtk_editable_delete_text (GTK_EDITABLE (entry), 0, -1);
tmp_pos = 0;