From 0b90b0b1e8ffd8a9cbed8d9618bf9e8731681a14 Mon Sep 17 00:00:00 2001 From: Gediminas Paulauskas Date: Tue, 10 Apr 2001 20:55:52 +0000 Subject: i18n fixes. i18n fixes. 2001-04-10 Gediminas Paulauskas * gal/widgets/e-unicode.c (e_utf8_*_*_string): if (!string) return NULL; to avoid crashes in strlen(NULL). TODO: need g_strlen which does that. 2001-04-10 Gediminas Paulauskas * e-table.c (et_real_construct): convert click_to_add_message locale->utf8. svn path=/trunk/; revision=9214 --- widgets/misc/e-unicode.c | 4 ++++ widgets/table/e-table.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c index 4d78d17788..fe16cb2102 100644 --- a/widgets/misc/e-unicode.c +++ b/widgets/misc/e-unicode.c @@ -283,6 +283,7 @@ e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes gchar * e_utf8_from_gtk_string (GtkWidget *widget, const gchar *string) { + if (!string) return NULL; return e_utf8_from_gtk_string_sized (widget, string, strlen (string)); } @@ -357,6 +358,7 @@ e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes) gchar * e_utf8_to_gtk_string (GtkWidget *widget, const gchar *string) { + if (!string) return NULL; return e_utf8_to_gtk_string_sized (widget, string, strlen (string)); } @@ -416,6 +418,7 @@ e_utf8_from_locale_string_sized (const gchar *string, gint bytes) gchar * e_utf8_from_locale_string (const gchar *string) { + if (!string) return NULL; return e_utf8_from_locale_string_sized (string, strlen (string)); } @@ -480,6 +483,7 @@ e_utf8_to_locale_string_sized (const gchar *string, gint bytes) gchar * e_utf8_to_locale_string (const gchar *string) { + if (!string) return NULL; return e_utf8_to_locale_string_sized (string, strlen (string)); } diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index febdfec56a..636b3f59b6 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -965,7 +965,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, ete = e_table_extras_new(); e_table->use_click_to_add = specification->click_to_add; - e_table->click_to_add_message = g_strdup (gettext (specification->click_to_add_message)); + e_table->click_to_add_message = e_utf8_from_locale_string (gettext (specification->click_to_add_message)); e_table->horizontal_draw_grid = specification->horizontal_draw_grid; e_table->vertical_draw_grid = specification->vertical_draw_grid; e_table->draw_focus = specification->draw_focus; -- cgit