Commit 96fb3e88 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Make string setters safe for self-assignment. (#122745, Soeren Sandmann)

Fri Nov  7 22:55:49 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwindow.c (gtk_window_set_role):
	* gtk/gtkwindow.c (gtk_window_set_title):
	* gtk/gtkwidget.c (gtk_widget_set_name):
	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
	* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
	safe for self-assignment.  (#122745, Soeren Sandmann)
parent 1ed2fe4a
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Thu Nov 6 20:41:40 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkstyle.c (gtk_style_attach): Fix doc comment.
......
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Thu Nov 6 20:41:40 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkstyle.c (gtk_style_attach): Fix doc comment.
......
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Thu Nov 6 20:41:40 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkstyle.c (gtk_style_attach): Fix doc comment.
......
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Thu Nov 6 20:41:40 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkstyle.c (gtk_style_attach): Fix doc comment.
......
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Thu Nov 6 20:41:40 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkstyle.c (gtk_style_attach): Fix doc comment.
......
......@@ -1133,10 +1133,13 @@ void
gtk_button_set_label (GtkButton *button,
const gchar *label)
{
g_return_if_fail (GTK_IS_BUTTON (button));
gchar *new_label;
g_return_if_fail (GTK_IS_BUTTON (button));
new_label = g_strdup (label);
g_free (button->label_text);
button->label_text = g_strdup (label);
button->label_text = new_label;
gtk_button_construct_child (button);
......
......@@ -2024,13 +2024,13 @@ void
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
const gchar *title)
{
gchar *new_title;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
new_title = g_strdup (title);
g_free (tree_column->title);
if (title)
tree_column->title = g_strdup (title);
else
tree_column->title = NULL;
tree_column->title = new_title;
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "title");
......
......@@ -3929,11 +3929,13 @@ void
gtk_widget_set_name (GtkWidget *widget,
const gchar *name)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gchar *new_name;
if (widget->name)
g_free (widget->name);
widget->name = g_strdup (name);
g_return_if_fail (GTK_IS_WIDGET (widget));
new_name = g_strdup (name);
g_free (widget->name);
widget->name = new_name;
if (GTK_WIDGET_RC_STYLE (widget))
gtk_widget_reset_rc_style (widget);
......
......@@ -987,11 +987,13 @@ void
gtk_window_set_title (GtkWindow *window,
const gchar *title)
{
char *new_title;
g_return_if_fail (GTK_IS_WINDOW (window));
if (window->title)
g_free (window->title);
window->title = g_strdup (title);
new_title = g_strdup (title);
g_free (window->title);
window->title = new_title;
if (GTK_WIDGET_REALIZED (window))
{
......@@ -1077,13 +1079,13 @@ void
gtk_window_set_role (GtkWindow *window,
const gchar *role)
{
char *new_role;
g_return_if_fail (GTK_IS_WINDOW (window));
if (role == window->wm_role)
return;
new_role = g_strdup (role);
g_free (window->wm_role);
window->wm_role = g_strdup (role);
window->wm_role = new_role;
if (GTK_WIDGET_REALIZED (window))
gdk_window_set_role (GTK_WIDGET (window)->window, window->wm_role);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment