From 5c1e0a1d9eea2d08e4d10c313f86c8eb634eaf4f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 2 Sep 2001 09:26:13 +0000 Subject: Strip spaces at the beginning or end as well as changing " " to " ". Fixes 2001-09-02 Christopher James Lahey * e-cell-date.c (ecd_get_text): Strip spaces at the beginning or end as well as changing " " to " ". Fixes Ximian bug #7683. svn path=/trunk/; revision=12560 --- widgets/table/e-cell-date.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'widgets/table/e-cell-date.c') diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index c8e2dd5f09..2c1873ae90 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -5,13 +5,16 @@ */ #include + +#include "e-cell-date.h" + #include #include #include +#include #include #include #include -#include "e-cell-date.h" #define PARENT_TYPE e_cell_text_get_type () @@ -25,6 +28,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) time_t yesdate; struct tm then, now, yesterday; char buf[26]; + char *temp, *ret_val; gboolean done = FALSE; if (date == 0) { @@ -93,8 +97,14 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) ctime_r (&date, buf); #endif #endif - - return e_utf8_from_locale_string (buf); + temp = buf; + while ((temp = strstr (temp, " "))) { + memmove (temp, temp + 1, strlen (temp)); + } + temp = e_strdup_strip (buf); + ret_val = e_utf8_from_locale_string (temp); + g_free (temp); + return ret_val; } static void -- cgit