[goffice] GOFormat: fix #629121.



commit 564046379c0986a0fadde665421e152e9a184211
Author: Morten Welinder <terra gnome org>
Date:   Fri Sep 10 14:39:26 2010 -0400

    GOFormat: fix #629121.

 ChangeLog                |    6 ++++++
 NEWS                     |    3 +++
 goffice/graph/gog-axis.c |   11 ++++++++++-
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8cc6be8..41c9d93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-10  Morten Welinder  <terra gnome org>
+
+	* goffice/graph/gog-axis.c (map_date_get_dim_format): If we have a
+	date format is time-of-day (or even a time format), make sure the
+	format we use has full time-of-day.
+
 2010-09-04  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index 4038b52..330f458 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.8.11:
 
+Morten:
+	* Improve fractional days support for date axes.
+
 --------------------------------------------------------------------------
 goffice 0.8.10:
 
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 3b6aa69..307192d 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -1025,8 +1025,17 @@ map_date_get_dim_format (GogAxis *axis, unsigned dim)
 {
 	switch (dim) {
 	case GOG_AXIS_ELEM_MIN:
-	case GOG_AXIS_ELEM_MAX:
+	case GOG_AXIS_ELEM_MAX: {
+		GOFormat *fmt = gog_axis_get_effective_format (axis);
+		/*
+		 * This is not a particular pretty solution to the problem
+		 * of bug #629121.  Improvements are welcome.
+		 */
+		if (go_format_is_date (fmt) == 2 ||
+		    go_format_is_time (fmt) >= 1)
+			return go_format_new_from_XL ("d-mmm-yy hh:mm:ss");
 		return go_format_new_magic (GO_FORMAT_MAGIC_MEDIUM_DATE);
+	}
 
 	case GOG_AXIS_ELEM_MAJOR_TICK:
 	case GOG_AXIS_ELEM_MINOR_TICK:



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