goffice r2341 - trunk/goffice/utils



Author: mortenw
Date: Fri Mar 20 14:56:51 2009
New Revision: 2341
URL: http://svn.gnome.org/viewvc/goffice?rev=2341&view=rev

Log:
Add new date/time magic format.



Modified:
   trunk/goffice/utils/go-format.c
   trunk/goffice/utils/go-format.h

Modified: trunk/goffice/utils/go-format.c
==============================================================================
--- trunk/goffice/utils/go-format.c	(original)
+++ trunk/goffice/utils/go-format.c	Fri Mar 20 14:56:51 2009
@@ -455,6 +455,19 @@
 		}
 	}
 
+	case GO_FORMAT_MAGIC_SHORT_DATETIME: {
+		/* xgettext: See http://projects.gnome.org/gnumeric/date-time-formats.shtml */
+		const char *fmt = _("*Short Date/Time Format");
+		if (fmt[0] && fmt[0] != '*')
+			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);
+			g_free (d);
+			return res;
+		}
+	}
+
 	case GO_FORMAT_MAGIC_LONG_TIME: {
 		/* xgettext: See http://projects.gnome.org/gnumeric/date-time-formats.shtml */
 		const char *fmt = _("*Long Time Format");
@@ -4450,6 +4463,10 @@
 		suffix = "m/d/yy";
 		break;
 
+	case GO_FORMAT_MAGIC_SHORT_DATETIME:
+		suffix = "m/d/yy h:mm";
+		break;
+
 	case GO_FORMAT_MAGIC_LONG_TIME:
 		suffix = "h:mm:ss AM/PM";
 		break;

Modified: trunk/goffice/utils/go-format.h
==============================================================================
--- trunk/goffice/utils/go-format.h	(original)
+++ trunk/goffice/utils/go-format.h	Fri Mar 20 14:56:51 2009
@@ -54,11 +54,12 @@
 typedef enum {
 	GO_FORMAT_MAGIC_NONE            = 0,
 	GO_FORMAT_MAGIC_LONG_DATE       = 0xf800,    /* Official */
-	GO_FORMAT_MAGIC_MEDIUM_DATE     = 0xfd01,
-	GO_FORMAT_MAGIC_SHORT_DATE      = 0xfd02,
+	GO_FORMAT_MAGIC_MEDIUM_DATE     = 0xf8f1,
+	GO_FORMAT_MAGIC_SHORT_DATE      = 0xf8f2,
+	GO_FORMAT_MAGIC_SHORT_DATETIME  = 0xf8fa,
 	GO_FORMAT_MAGIC_LONG_TIME       = 0xf400,    /* Official */
-	GO_FORMAT_MAGIC_MEDIUM_TIME     = 0xfd11,
-	GO_FORMAT_MAGIC_SHORT_TIME      = 0xfd12
+	GO_FORMAT_MAGIC_MEDIUM_TIME     = 0xf4f1,
+	GO_FORMAT_MAGIC_SHORT_TIME      = 0xf4f2
 } GOFormatMagic;
 
 typedef enum {



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