goffice r2046 - in trunk: . goffice/utils



Author: mortenw
Date: Thu Mar 13 00:47:31 2008
New Revision: 2046
URL: http://svn.gnome.org/viewvc/goffice?rev=2046&view=rev

Log:
2008-03-12  Morten Welinder  <terra gnome org>

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



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

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Thu Mar 13 00:47:31 2008
@@ -1,5 +1,7 @@
 goffice 0.6.3:
 
+Morten:
+	* Add go_format_is_invalid.
 
 --------------------------------------------------------------------------
 goffice 0.6.2:

Modified: trunk/goffice/utils/go-format.c
==============================================================================
--- trunk/goffice/utils/go-format.c	(original)
+++ trunk/goffice/utils/go-format.c	Thu Mar 13 00:47:31 2008
@@ -4018,6 +4018,21 @@
 
 #ifdef DEFINE_COMMON
 /**
+ * go_format_is_invalid
+ * @fmt: Format to query
+ *
+ * Returns: TRUE if, and if only, the format is invalid
+ **/
+gboolean
+go_format_is_invalid (GOFormat const *fmt)
+{
+	g_return_val_if_fail (fmt != NULL, TRUE);
+	return fmt->typ == GO_FMT_INVALID;
+}
+#endif
+
+#ifdef DEFINE_COMMON
+/**
  * go_format_is_general
  * @fmt: Format to query
  *
@@ -4029,6 +4044,7 @@
 gboolean
 go_format_is_general (GOFormat const *fmt)
 {
+	g_return_val_if_fail (fmt != NULL, FALSE);
 	return fmt->typ == GO_FMT_NUMBER && fmt->u.number.is_general;
 }
 #endif
@@ -4044,6 +4060,7 @@
 gboolean
 go_format_is_markup (GOFormat const *fmt)
 {
+	g_return_val_if_fail (fmt != NULL, FALSE);
 	return fmt->typ == GO_FMT_MARKUP;
 }
 #endif
@@ -4059,6 +4076,7 @@
 gboolean
 go_format_is_text (GOFormat const *fmt)
 {
+	g_return_val_if_fail (fmt != NULL, FALSE);
 	return fmt->typ == GO_FMT_TEXT;
 }
 #endif
@@ -4126,6 +4144,8 @@
 int
 go_format_month_before_day (GOFormat const *fmt)
 {
+	g_return_val_if_fail (fmt != NULL, -1);
+
 	if (go_format_is_date (fmt) != 1)
 		return -1;
 	if (fmt->u.number.date_ybm)
@@ -4150,6 +4170,8 @@
 gboolean
 go_format_has_hour (GOFormat const *fmt)
 {
+	g_return_val_if_fail (fmt != NULL, FALSE);
+
 	return (fmt->typ == GO_FMT_NUMBER &&
 		fmt->u.number.has_time &&
 		fmt->u.number.has_hour);

Modified: trunk/goffice/utils/go-format.h
==============================================================================
--- trunk/goffice/utils/go-format.h	(original)
+++ trunk/goffice/utils/go-format.h	Thu Mar 13 00:47:31 2008
@@ -100,6 +100,7 @@
 GOFormat *go_format_ref		 	(GOFormat *fmt);
 void      go_format_unref		(GOFormat *fmt);
 
+gboolean  go_format_is_invalid          (GOFormat const *fmt);
 gboolean  go_format_is_general          (GOFormat const *fmt);
 gboolean  go_format_is_markup           (GOFormat const *fmt);
 gboolean  go_format_is_text             (GOFormat const *fmt);



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