Commit 96feea59 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

*** empty log message ***

parent f32d4e88
2003-12-19 Jon K Hellan <hellan@acm.org>
* src/format-template.c (format_template_new): Use gnm_get_real_name.
* src/summary.c (summary_info_default): UTF-8 encode author name.
(summary_item_new_string): Validate string as utf-8.
* src/gutils.[ch] (gnm_get_real_name): New function.
2003-12-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_scroll_wheel_support_cb) : support
......
2003-12-19 Jon K Hellan <hellan@acm.org>
* src/format-template.c (format_template_new): Use gnm_get_real_name.
* src/summary.c (summary_info_default): UTF-8 encode author name.
(summary_item_new_string): Validate string as utf-8.
* src/gutils.[ch] (gnm_get_real_name): New function.
2003-12-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_scroll_wheel_support_cb) : support
......
2003-12-19 Jon K Hellan <hellan@acm.org>
* src/format-template.c (format_template_new): Use gnm_get_real_name.
* src/summary.c (summary_info_default): UTF-8 encode author name.
(summary_item_new_string): Validate string as utf-8.
* src/gutils.[ch] (gnm_get_real_name): New function.
2003-12-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_scroll_wheel_support_cb) : support
......
2003-12-19 Jon K Hellan <hellan@acm.org>
* ms-excel-write.c (excel_write_WRITEACCESS): Use
gnm_get_real_name to get user name.
2003-12-18 Jody Goldberg <jody@gnome.org>
* ms-chart.c (XL_gog_series_set_dim) : Don't leak data we're not
......
......@@ -3968,7 +3968,7 @@ excel_write_WRITEACCESS (BiffPut *bp)
{
guint8 pad [112];
unsigned len;
gchar *utf8_name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL);
gchar *utf8_name = gnm_get_real_name ();
if (utf8_name == NULL)
utf8_name = g_strdup ("");
......
......@@ -243,7 +243,7 @@ format_template_new (void)
ft = g_new0 (FormatTemplate, 1);
ft->filename = g_strdup ("");
ft->author = g_strdup (g_get_real_name ());
ft->author = g_strdup (gnm_get_real_name ());
ft->name = g_strdup (_("Name"));
ft->description = g_strdup ("");
......
......@@ -910,3 +910,22 @@ gnm_guess_encoding (const char *raw, size_t len, const char *user_guess,
g_error_free (error);
}
}
const char*
gnm_get_real_name (void)
{
static char *gnm_real_name = NULL;
if (!gnm_real_name) {
char *name = getenv ("NAME");
if (!name) {
name = (char *) g_get_real_name ();
if (name) {
const char *enc = gnm_guess_encoding
(name, strlen (name), NULL,
&gnm_real_name);
}
}
}
return gnm_real_name;
}
......@@ -94,5 +94,6 @@ gpointer gnm_mem_chunk_alloc (GnmMemChunk *);
gpointer gnm_mem_chunk_alloc0 (GnmMemChunk *);
void gnm_mem_chunk_free (GnmMemChunk *, gpointer);
void gnm_mem_chunk_foreach_leak (GnmMemChunk *, GFunc, gpointer);
const char* gnm_get_real_name (void);
#endif /* GNUMERIC_UTILS_H */
......@@ -101,8 +101,13 @@ summary_item_new_time (gchar const *name, GTimeVal t)
SummaryItem *
summary_item_new_string (gchar const *name, gchar const *string, gboolean copy)
{
SummaryItem *sit = summary_item_new (name, SUMMARY_STRING);
sit->v.txt = copy ? g_strdup (string) : (char *)string;
SummaryItem *sit = NULL;
gboolean valid = g_utf8_validate (string, -1, NULL);
if (valid) {
sit = summary_item_new (name, SUMMARY_STRING);
sit->v.txt = copy ? g_strdup (string) : (char *)string;
}
return sit;
}
......@@ -270,7 +275,7 @@ summary_info_default (SummaryInfo *sin)
g_return_if_fail (sin != NULL);
sit = summary_item_new_string (summary_item_name [SUMMARY_I_AUTHOR],
g_get_real_name (), TRUE);
gnm_get_real_name (), TRUE);
summary_info_add (sin, sit);
sit = summary_item_new_string (summary_item_name [SUMMARY_I_APP],
......
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