goffice r2331 - in trunk: . goffice/utils



Author: mortenw
Date: Sun Mar 15 19:07:20 2009
New Revision: 2331
URL: http://svn.gnome.org/viewvc/goffice?rev=2331&view=rev

Log:
2009-03-15  Morten Welinder  <terra gnome org>

	* goffice/utils/go-format.c (go_format_default_accounting): New
	function.



Modified:
   trunk/ChangeLog
   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	Sun Mar 15 19:07:20 2009
@@ -413,6 +413,7 @@
 
 static GOFormat *default_percentage_fmt;
 static GOFormat *default_money_fmt;
+static GOFormat *default_accounting_fmt;
 static GOFormat *default_date_fmt;
 static GOFormat *default_time_fmt;
 static GOFormat *default_date_time_fmt;
@@ -3254,6 +3255,11 @@
 		default_money_fmt = NULL;
 	}
 
+	if (default_accounting_fmt) {
+		go_format_unref (default_accounting_fmt);
+		default_accounting_fmt = NULL;
+	}
+
 	if (default_date_fmt) {
 		go_format_unref (default_date_fmt);
 		default_date_fmt = NULL;
@@ -4387,3 +4393,14 @@
 	return default_money_fmt;
 }
 #endif
+
+#ifdef DEFINE_COMMON
+GOFormat *
+go_format_default_accounting (void)
+{
+	if (!default_accounting_fmt)
+		default_accounting_fmt = go_format_new_from_XL (
+			go_format_builtins[GO_FORMAT_ACCOUNTING][2]);
+	return default_accounting_fmt;
+}
+#endif

Modified: trunk/goffice/utils/go-format.h
==============================================================================
--- trunk/goffice/utils/go-format.h	(original)
+++ trunk/goffice/utils/go-format.h	Sun Mar 15 19:07:20 2009
@@ -92,6 +92,7 @@
 GOFormat *go_format_default_date_time	(void);
 GOFormat *go_format_default_percentage	(void);
 GOFormat *go_format_default_money	(void);
+GOFormat *go_format_default_accounting  (void);
 
 char     *go_format_str_localize        (char const *str);
 char	 *go_format_str_delocalize	(char const *str);



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