[goffice] graphs: fix crash.



commit 9622addcd162c9387a1a915091cf233cd70722e2
Author: Morten Welinder <terra gnome org>
Date:   Sun Aug 29 20:25:06 2010 -0400

    graphs: fix crash.

 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 goffice/graph/gog-axis.c |    3 ++-
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4885e76..5b23bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-29  Morten Welinder  <terra gnome org>
+
+	* goffice/graph/gog-axis.c (map_date_calc_ticks): Fix condition
+	for weekly axis.  Fixes #628259.
+
 2010-08-24  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* goffice/app/io-context.c (go_io_error_info_set): don't be overzealous
diff --git a/NEWS b/NEWS
index 377be40..0abbd99 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Morten:
 	* Fix minor go_string_replace issue.
 	* Plug leaks.
 	* Fix char-xmlChar confusion.
+	* Fix graph crash.  [#628259]
 
 --------------------------------------------------------------------------
 goffice 0.8.9:
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 52e8ad4..0b7d47a 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -907,7 +907,8 @@ map_date_calc_ticks (GogAxis *axis)
 	major_tick = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MAJOR_TICK, NULL);
 	minor_tick = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MINOR_TICK, NULL);
 
-	major_is_weeks = (major_tick > 0 && major_tick <= 28 &&
+	major_is_weeks = (major_tick >= 7 && major_tick <= 28 &&
+			  major_tick == floor (major_tick) &&
 			  (int)major_tick % 7 == 0);
 	if (major_is_weeks) {
 		map_week_calc_ticks (axis);



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