[goffice] GOFormat: fix default time, date, datetime formats to use magic formats.



commit 35448dfa06d6ca1b2313457e2e33636eb430794e
Author: Morten Welinder <terra gnome org>
Date:   Fri May 29 19:17:13 2009 -0400

    GOFormat: fix default time, date, datetime formats to use magic formats.
---
 ChangeLog                 |    7 +++++--
 goffice/utils/go-format.c |   14 ++++++++------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7fe6a90..5abd3d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
 2009-05-29  Morten Welinder  <terra gnome org>
 
 	* goffice/utils/go-format.c (go_format_default_date_time): Make
-	this GO_FORMAT_MAGIC_SHORT_TIME instead of just picking the fifth
-	format we happen to generate.
+	this GO_FORMAT_MAGIC_SHORT_DATETIME instead of just picking the
+	fifth time format we happen to generate.
+	(go_format_default_date, go_format_default_time): Similar.
+	(go_format_magic_fmt_str): Fix GO_FORMAT_MAGIC_SHORT_DATETIME to
+	use GO_FORMAT_MAGIC_SHORT_TIME's format.
 
 2009-05-28  Andreas J. Guelzow  <aguelzow pyrshep ca>
 
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index e919146..bc068ac 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -470,8 +470,10 @@ go_format_magic_fmt_str (GOFormatMagic m)
 			return g_strdup (fmt);
 		else {
 			char *d = go_format_magic_fmt_str (GO_FORMAT_MAGIC_SHORT_DATE);
-			char *res = g_strconcat (d, " h:mm", NULL);
+			char *t = go_format_magic_fmt_str (GO_FORMAT_MAGIC_SHORT_TIME);
+			char *res = g_strconcat (d, " ", t, NULL);
 			g_free (d);
+			g_free (t);
 			return res;
 		}
 	}
@@ -4854,8 +4856,8 @@ GOFormat *
 go_format_default_date (void)
 {
 	if (!default_date_fmt)
-		default_date_fmt = go_format_new_from_XL (
-			go_format_builtins[GO_FORMAT_DATE][0]);
+		default_date_fmt =
+			go_format_new_magic (GO_FORMAT_MAGIC_SHORT_DATE);
 	return default_date_fmt;
 }
 #endif
@@ -4865,8 +4867,8 @@ GOFormat *
 go_format_default_time (void)
 {
 	if (!default_time_fmt)
-		default_time_fmt = go_format_new_from_XL (
-			go_format_builtins[GO_FORMAT_TIME][0]);
+		default_time_fmt =
+			go_format_new_magic (GO_FORMAT_MAGIC_SHORT_TIME);
 	return default_time_fmt;
 }
 #endif
@@ -4877,7 +4879,7 @@ go_format_default_date_time (void)
 {
 	if (!default_date_time_fmt)
 		default_date_time_fmt =
-			go_format_new_magic (GO_FORMAT_MAGIC_SHORT_TIME);
+			go_format_new_magic (GO_FORMAT_MAGIC_SHORT_DATETIME);
 	return default_date_time_fmt;
 }
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]